aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_ioctl.c
diff options
context:
space:
mode:
authorNathan Scott <nathans@sgi.com>2005-06-21 01:48:04 -0400
committerNathan Scott <nathans@sgi.com>2005-06-21 01:48:04 -0400
commit77bc5beb5977a166e41b87c9d55d8e9cf2b3a04f (patch)
treec4721d0fe343cb7c0bc0f61720581f2498b2b0bb /fs/xfs/linux-2.6/xfs_ioctl.c
parentbd5a876ac4c130e8e1986dcdbb21839ae4cd91c0 (diff)
[XFS] Makes more sense to use the fsxattr interface instead of adding new
ioctls for project IDs. SGI-PV: 938145 SGI-Modid: xfs-linux:xfs-kern:22899a 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.c33
1 files changed, 8 insertions, 25 deletions
diff --git a/fs/xfs/linux-2.6/xfs_ioctl.c b/fs/xfs/linux-2.6/xfs_ioctl.c
index df17d93bd096..05a447e51cc0 100644
--- a/fs/xfs/linux-2.6/xfs_ioctl.c
+++ b/fs/xfs/linux-2.6/xfs_ioctl.c
@@ -777,8 +777,6 @@ 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:
782 case XFS_IOC_FSGETXATTR: 780 case XFS_IOC_FSGETXATTR:
783 case XFS_IOC_FSSETXATTR: 781 case XFS_IOC_FSSETXATTR:
784 case XFS_IOC_FSGETXATTRA: 782 case XFS_IOC_FSGETXATTRA:
@@ -1176,7 +1174,8 @@ xfs_ioc_xattr(
1176 1174
1177 switch (cmd) { 1175 switch (cmd) {
1178 case XFS_IOC_FSGETXATTR: { 1176 case XFS_IOC_FSGETXATTR: {
1179 va.va_mask = XFS_AT_XFLAGS|XFS_AT_EXTSIZE|XFS_AT_NEXTENTS; 1177 va.va_mask = XFS_AT_XFLAGS | XFS_AT_EXTSIZE | \
1178 XFS_AT_NEXTENTS | XFS_AT_PROJID;
1180 VOP_GETATTR(vp, &va, 0, NULL, error); 1179 VOP_GETATTR(vp, &va, 0, NULL, error);
1181 if (error) 1180 if (error)
1182 return -error; 1181 return -error;
@@ -1184,6 +1183,7 @@ xfs_ioc_xattr(
1184 fa.fsx_xflags = va.va_xflags; 1183 fa.fsx_xflags = va.va_xflags;
1185 fa.fsx_extsize = va.va_extsize; 1184 fa.fsx_extsize = va.va_extsize;
1186 fa.fsx_nextents = va.va_nextents; 1185 fa.fsx_nextents = va.va_nextents;
1186 fa.fsx_projid = va.va_projid;
1187 1187
1188 if (copy_to_user(arg, &fa, sizeof(fa))) 1188 if (copy_to_user(arg, &fa, sizeof(fa)))
1189 return -XFS_ERROR(EFAULT); 1189 return -XFS_ERROR(EFAULT);
@@ -1198,9 +1198,10 @@ xfs_ioc_xattr(
1198 if (filp->f_flags & (O_NDELAY|O_NONBLOCK)) 1198 if (filp->f_flags & (O_NDELAY|O_NONBLOCK))
1199 attr_flags |= ATTR_NONBLOCK; 1199 attr_flags |= ATTR_NONBLOCK;
1200 1200
1201 va.va_mask = XFS_AT_XFLAGS | XFS_AT_EXTSIZE; 1201 va.va_mask = XFS_AT_XFLAGS | XFS_AT_EXTSIZE | XFS_AT_PROJID;
1202 va.va_xflags = fa.fsx_xflags; 1202 va.va_xflags = fa.fsx_xflags;
1203 va.va_extsize = fa.fsx_extsize; 1203 va.va_extsize = fa.fsx_extsize;
1204 va.va_projid = fa.fsx_projid;
1204 1205
1205 VOP_SETATTR(vp, &va, attr_flags, NULL, error); 1206 VOP_SETATTR(vp, &va, attr_flags, NULL, error);
1206 if (!error) 1207 if (!error)
@@ -1209,7 +1210,8 @@ xfs_ioc_xattr(
1209 } 1210 }
1210 1211
1211 case XFS_IOC_FSGETXATTRA: { 1212 case XFS_IOC_FSGETXATTRA: {
1212 va.va_mask = XFS_AT_XFLAGS|XFS_AT_EXTSIZE|XFS_AT_ANEXTENTS; 1213 va.va_mask = XFS_AT_XFLAGS | XFS_AT_EXTSIZE | \
1214 XFS_AT_ANEXTENTS | XFS_AT_PROJID;
1213 VOP_GETATTR(vp, &va, 0, NULL, error); 1215 VOP_GETATTR(vp, &va, 0, NULL, error);
1214 if (error) 1216 if (error)
1215 return -error; 1217 return -error;
@@ -1217,6 +1219,7 @@ xfs_ioc_xattr(
1217 fa.fsx_xflags = va.va_xflags; 1219 fa.fsx_xflags = va.va_xflags;
1218 fa.fsx_extsize = va.va_extsize; 1220 fa.fsx_extsize = va.va_extsize;
1219 fa.fsx_nextents = va.va_anextents; 1221 fa.fsx_nextents = va.va_anextents;
1222 fa.fsx_projid = va.va_projid;
1220 1223
1221 if (copy_to_user(arg, &fa, sizeof(fa))) 1224 if (copy_to_user(arg, &fa, sizeof(fa)))
1222 return -XFS_ERROR(EFAULT); 1225 return -XFS_ERROR(EFAULT);
@@ -1260,26 +1263,6 @@ xfs_ioc_xattr(
1260 return 0; 1263 return 0;
1261 } 1264 }
1262 1265
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
1283 default: 1266 default:
1284 return -ENOTTY; 1267 return -ENOTTY;
1285 } 1268 }