提交 77bc5beb 编写于 作者: N Nathan Scott

[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: NNathan Scott <nathans@sgi.com>
上级 bd5a876a
...@@ -777,8 +777,6 @@ xfs_ioctl( ...@@ -777,8 +777,6 @@ xfs_ioctl(
case XFS_IOC_GETVERSION: case XFS_IOC_GETVERSION:
case XFS_IOC_GETXFLAGS: case XFS_IOC_GETXFLAGS:
case XFS_IOC_SETXFLAGS: case XFS_IOC_SETXFLAGS:
case XFS_IOC_GETPROJID:
case XFS_IOC_SETPROJID:
case XFS_IOC_FSGETXATTR: case XFS_IOC_FSGETXATTR:
case XFS_IOC_FSSETXATTR: case XFS_IOC_FSSETXATTR:
case XFS_IOC_FSGETXATTRA: case XFS_IOC_FSGETXATTRA:
...@@ -1176,7 +1174,8 @@ xfs_ioc_xattr( ...@@ -1176,7 +1174,8 @@ xfs_ioc_xattr(
switch (cmd) { switch (cmd) {
case XFS_IOC_FSGETXATTR: { case XFS_IOC_FSGETXATTR: {
va.va_mask = XFS_AT_XFLAGS|XFS_AT_EXTSIZE|XFS_AT_NEXTENTS; va.va_mask = XFS_AT_XFLAGS | XFS_AT_EXTSIZE | \
XFS_AT_NEXTENTS | XFS_AT_PROJID;
VOP_GETATTR(vp, &va, 0, NULL, error); VOP_GETATTR(vp, &va, 0, NULL, error);
if (error) if (error)
return -error; return -error;
...@@ -1184,6 +1183,7 @@ xfs_ioc_xattr( ...@@ -1184,6 +1183,7 @@ xfs_ioc_xattr(
fa.fsx_xflags = va.va_xflags; fa.fsx_xflags = va.va_xflags;
fa.fsx_extsize = va.va_extsize; fa.fsx_extsize = va.va_extsize;
fa.fsx_nextents = va.va_nextents; fa.fsx_nextents = va.va_nextents;
fa.fsx_projid = va.va_projid;
if (copy_to_user(arg, &fa, sizeof(fa))) if (copy_to_user(arg, &fa, sizeof(fa)))
return -XFS_ERROR(EFAULT); return -XFS_ERROR(EFAULT);
...@@ -1198,9 +1198,10 @@ xfs_ioc_xattr( ...@@ -1198,9 +1198,10 @@ xfs_ioc_xattr(
if (filp->f_flags & (O_NDELAY|O_NONBLOCK)) if (filp->f_flags & (O_NDELAY|O_NONBLOCK))
attr_flags |= ATTR_NONBLOCK; attr_flags |= ATTR_NONBLOCK;
va.va_mask = XFS_AT_XFLAGS | XFS_AT_EXTSIZE; va.va_mask = XFS_AT_XFLAGS | XFS_AT_EXTSIZE | XFS_AT_PROJID;
va.va_xflags = fa.fsx_xflags; va.va_xflags = fa.fsx_xflags;
va.va_extsize = fa.fsx_extsize; va.va_extsize = fa.fsx_extsize;
va.va_projid = fa.fsx_projid;
VOP_SETATTR(vp, &va, attr_flags, NULL, error); VOP_SETATTR(vp, &va, attr_flags, NULL, error);
if (!error) if (!error)
...@@ -1209,7 +1210,8 @@ xfs_ioc_xattr( ...@@ -1209,7 +1210,8 @@ xfs_ioc_xattr(
} }
case XFS_IOC_FSGETXATTRA: { case XFS_IOC_FSGETXATTRA: {
va.va_mask = XFS_AT_XFLAGS|XFS_AT_EXTSIZE|XFS_AT_ANEXTENTS; va.va_mask = XFS_AT_XFLAGS | XFS_AT_EXTSIZE | \
XFS_AT_ANEXTENTS | XFS_AT_PROJID;
VOP_GETATTR(vp, &va, 0, NULL, error); VOP_GETATTR(vp, &va, 0, NULL, error);
if (error) if (error)
return -error; return -error;
...@@ -1217,6 +1219,7 @@ xfs_ioc_xattr( ...@@ -1217,6 +1219,7 @@ xfs_ioc_xattr(
fa.fsx_xflags = va.va_xflags; fa.fsx_xflags = va.va_xflags;
fa.fsx_extsize = va.va_extsize; fa.fsx_extsize = va.va_extsize;
fa.fsx_nextents = va.va_anextents; fa.fsx_nextents = va.va_anextents;
fa.fsx_projid = va.va_projid;
if (copy_to_user(arg, &fa, sizeof(fa))) if (copy_to_user(arg, &fa, sizeof(fa)))
return -XFS_ERROR(EFAULT); return -XFS_ERROR(EFAULT);
...@@ -1260,26 +1263,6 @@ xfs_ioc_xattr( ...@@ -1260,26 +1263,6 @@ xfs_ioc_xattr(
return 0; return 0;
} }
case XFS_IOC_GETPROJID: {
va.va_mask = XFS_AT_PROJID;
VOP_GETATTR(vp, &va, 0, NULL, error);
if (error)
return -error;
if (copy_to_user(arg, &va.va_projid, sizeof(va.va_projid)))
return -XFS_ERROR(EFAULT);
return 0;
}
case XFS_IOC_SETPROJID: {
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
va.va_mask = XFS_AT_PROJID;
if (copy_from_user(&va.va_projid, arg, sizeof(va.va_projid)))
return -XFS_ERROR(EFAULT);
VOP_SETATTR(vp, &va, 0, NULL, error);
return -error;
}
default: default:
return -ENOTTY; return -ENOTTY;
} }
......
...@@ -100,8 +100,6 @@ __linvfs_compat_ioctl(int mode, struct file *f, unsigned cmd, unsigned long arg) ...@@ -100,8 +100,6 @@ __linvfs_compat_ioctl(int mode, struct file *f, unsigned cmd, unsigned long arg)
case XFS_IOC_GETBMAP: case XFS_IOC_GETBMAP:
case XFS_IOC_GETBMAPA: case XFS_IOC_GETBMAPA:
case XFS_IOC_GETBMAPX: case XFS_IOC_GETBMAPX:
case XFS_IOC_SETPROJID:
case XFS_IOC_GETPROJID:
/* not handled /* not handled
case XFS_IOC_FD_TO_HANDLE: case XFS_IOC_FD_TO_HANDLE:
case XFS_IOC_PATH_TO_HANDLE: case XFS_IOC_PATH_TO_HANDLE:
......
...@@ -60,7 +60,8 @@ struct fsxattr { ...@@ -60,7 +60,8 @@ struct fsxattr {
__u32 fsx_xflags; /* xflags field value (get/set) */ __u32 fsx_xflags; /* xflags field value (get/set) */
__u32 fsx_extsize; /* extsize field value (get/set)*/ __u32 fsx_extsize; /* extsize field value (get/set)*/
__u32 fsx_nextents; /* nextents field value (get) */ __u32 fsx_nextents; /* nextents field value (get) */
unsigned char fsx_pad[16]; __u32 fsx_projid; /* project identifier (get/set) */
unsigned char fsx_pad[12];
}; };
#endif #endif
...@@ -477,8 +478,6 @@ typedef struct xfs_handle { ...@@ -477,8 +478,6 @@ typedef struct xfs_handle {
/* XFS_IOC_SETBIOSIZE ---- deprecated 46 */ /* XFS_IOC_SETBIOSIZE ---- deprecated 46 */
/* XFS_IOC_GETBIOSIZE ---- deprecated 47 */ /* XFS_IOC_GETBIOSIZE ---- deprecated 47 */
#define XFS_IOC_GETBMAPX _IOWR('X', 56, struct getbmap) #define XFS_IOC_GETBMAPX _IOWR('X', 56, struct getbmap)
#define XFS_IOC_SETPROJID _IOWR('X', 57, __uint32_t)
#define XFS_IOC_GETPROJID _IOWR('X', 58, __uint32_t)
/* /*
* ioctl commands that replace IRIX syssgi()'s * ioctl commands that replace IRIX syssgi()'s
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册