summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_ioctl.c')
-rw-r--r--fs/xfs/xfs_ioctl.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
index ec3c6c401ee7..b36abd453709 100644
--- a/fs/xfs/xfs_ioctl.c
+++ b/fs/xfs/xfs_ioctl.c
@@ -33,6 +33,7 @@
#include "xfs_fsmap.h"
#include "scrub/xfs_scrub.h"
#include "xfs_sb.h"
+#include "xfs_ag.h"
#include <linux/capability.h>
#include <linux/cred.h>
@@ -804,6 +805,26 @@ xfs_ioc_fsgeometry(
return 0;
}
+STATIC int
+xfs_ioc_ag_geometry(
+ struct xfs_mount *mp,
+ void __user *arg)
+{
+ struct xfs_ag_geometry ageo;
+ int error;
+
+ if (copy_from_user(&ageo, arg, sizeof(ageo)))
+ return -EFAULT;
+
+ error = xfs_ag_get_geometry(mp, ageo.ag_number, &ageo);
+ if (error)
+ return error;
+
+ if (copy_to_user(arg, &ageo, sizeof(ageo)))
+ return -EFAULT;
+ return 0;
+}
+
/*
* Linux extended inode flags interface.
*/
@@ -1930,6 +1951,9 @@ xfs_file_ioctl(
case XFS_IOC_FSGEOMETRY:
return xfs_ioc_fsgeometry(mp, arg, 5);
+ case XFS_IOC_AG_GEOMETRY:
+ return xfs_ioc_ag_geometry(mp, arg);
+
case XFS_IOC_GETVERSION:
return put_user(inode->i_generation, (int __user *)arg);