aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_ioctl.c
diff options
context:
space:
mode:
authorNathan Scott <nathans@sgi.com>2005-06-20 23:21:49 -0400
committerNathan Scott <nathans@sgi.com>2005-06-20 23:21:49 -0400
commitb74e2159c9849fb97659c6dc47ad706f702b22b9 (patch)
treea2fd0ade921c483b10aee42be2c3b30ceb2c02c7 /fs/xfs/linux-2.6/xfs_ioctl.c
parent91b90475e793e84a57d956af8c52645e292badcb (diff)
[XFS] Add a get/set interface for XFS project identifiers.
SGI-PV: 932952 SGI-Modid: xfs-linux:xfs-kern:21938a Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_ioctl.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_ioctl.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/fs/xfs/linux-2.6/xfs_ioctl.c b/fs/xfs/linux-2.6/xfs_ioctl.c
index 69809eef8a54..df17d93bd096 100644
--- a/fs/xfs/linux-2.6/xfs_ioctl.c
+++ b/fs/xfs/linux-2.6/xfs_ioctl.c
@@ -777,6 +777,8 @@ xfs_ioctl(
777 case XFS_IOC_GETVERSION: 777 case XFS_IOC_GETVERSION:
778 case XFS_IOC_GETXFLAGS: 778 case XFS_IOC_GETXFLAGS:
779 case XFS_IOC_SETXFLAGS: 779 case XFS_IOC_SETXFLAGS:
780 case XFS_IOC_GETPROJID:
781 case XFS_IOC_SETPROJID:
780 case XFS_IOC_FSGETXATTR: 782 case XFS_IOC_FSGETXATTR:
781 case XFS_IOC_FSSETXATTR: 783 case XFS_IOC_FSSETXATTR:
782 case XFS_IOC_FSGETXATTRA: 784 case XFS_IOC_FSGETXATTRA:
@@ -1258,6 +1260,26 @@ xfs_ioc_xattr(
1258 return 0; 1260 return 0;
1259 } 1261 }
1260 1262
1263 case XFS_IOC_GETPROJID: {
1264 va.va_mask = XFS_AT_PROJID;
1265 VOP_GETATTR(vp, &va, 0, NULL, error);
1266 if (error)
1267 return -error;
1268 if (copy_to_user(arg, &va.va_projid, sizeof(va.va_projid)))
1269 return -XFS_ERROR(EFAULT);
1270 return 0;
1271 }
1272
1273 case XFS_IOC_SETPROJID: {
1274 if (!capable(CAP_SYS_ADMIN))
1275 return -EPERM;
1276 va.va_mask = XFS_AT_PROJID;
1277 if (copy_from_user(&va.va_projid, arg, sizeof(va.va_projid)))
1278 return -XFS_ERROR(EFAULT);
1279 VOP_SETATTR(vp, &va, 0, NULL, error);
1280 return -error;
1281 }
1282
1261 default: 1283 default:
1262 return -ENOTTY; 1284 return -ENOTTY;
1263 } 1285 }