diff options
author | Nathan Scott <nathans@sgi.com> | 2005-06-20 23:21:49 -0400 |
---|---|---|
committer | Nathan Scott <nathans@sgi.com> | 2005-06-20 23:21:49 -0400 |
commit | b74e2159c9849fb97659c6dc47ad706f702b22b9 (patch) | |
tree | a2fd0ade921c483b10aee42be2c3b30ceb2c02c7 | |
parent | 91b90475e793e84a57d956af8c52645e292badcb (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>
-rw-r--r-- | fs/xfs/linux-2.6/xfs_ioctl.c | 22 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_ioctl32.c | 2 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_vnode.h | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_fs.h | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_types.h | 2 |
5 files changed, 28 insertions, 2 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 | } |
diff --git a/fs/xfs/linux-2.6/xfs_ioctl32.c b/fs/xfs/linux-2.6/xfs_ioctl32.c index 0f8f1384eb36..be72aca59447 100644 --- a/fs/xfs/linux-2.6/xfs_ioctl32.c +++ b/fs/xfs/linux-2.6/xfs_ioctl32.c | |||
@@ -100,6 +100,8 @@ __linvfs_compat_ioctl(int mode, struct file *f, unsigned cmd, unsigned long arg) | |||
100 | case XFS_IOC_GETBMAP: | 100 | case XFS_IOC_GETBMAP: |
101 | case XFS_IOC_GETBMAPA: | 101 | case XFS_IOC_GETBMAPA: |
102 | case XFS_IOC_GETBMAPX: | 102 | case XFS_IOC_GETBMAPX: |
103 | case XFS_IOC_SETPROJID: | ||
104 | case XFS_IOC_GETPROJID: | ||
103 | /* not handled | 105 | /* not handled |
104 | case XFS_IOC_FD_TO_HANDLE: | 106 | case XFS_IOC_FD_TO_HANDLE: |
105 | case XFS_IOC_PATH_TO_HANDLE: | 107 | case XFS_IOC_PATH_TO_HANDLE: |
diff --git a/fs/xfs/linux-2.6/xfs_vnode.h b/fs/xfs/linux-2.6/xfs_vnode.h index 00466c3194ac..a6e57c647be4 100644 --- a/fs/xfs/linux-2.6/xfs_vnode.h +++ b/fs/xfs/linux-2.6/xfs_vnode.h | |||
@@ -426,7 +426,7 @@ typedef struct vattr { | |||
426 | u_long va_extsize; /* file extent size */ | 426 | u_long va_extsize; /* file extent size */ |
427 | u_long va_nextents; /* number of extents in file */ | 427 | u_long va_nextents; /* number of extents in file */ |
428 | u_long va_anextents; /* number of attr extents in file */ | 428 | u_long va_anextents; /* number of attr extents in file */ |
429 | int va_projid; /* project id */ | 429 | prid_t va_projid; /* project id */ |
430 | } vattr_t; | 430 | } vattr_t; |
431 | 431 | ||
432 | /* | 432 | /* |
diff --git a/fs/xfs/xfs_fs.h b/fs/xfs/xfs_fs.h index 6ee8443bf9d3..a7bd4687fa50 100644 --- a/fs/xfs/xfs_fs.h +++ b/fs/xfs/xfs_fs.h | |||
@@ -477,6 +477,8 @@ typedef struct xfs_handle { | |||
477 | /* XFS_IOC_SETBIOSIZE ---- deprecated 46 */ | 477 | /* XFS_IOC_SETBIOSIZE ---- deprecated 46 */ |
478 | /* XFS_IOC_GETBIOSIZE ---- deprecated 47 */ | 478 | /* XFS_IOC_GETBIOSIZE ---- deprecated 47 */ |
479 | #define XFS_IOC_GETBMAPX _IOWR('X', 56, struct getbmap) | 479 | #define XFS_IOC_GETBMAPX _IOWR('X', 56, struct getbmap) |
480 | #define XFS_IOC_SETPROJID _IOWR('X', 57, __uint32_t) | ||
481 | #define XFS_IOC_GETPROJID _IOWR('X', 58, __uint32_t) | ||
480 | 482 | ||
481 | /* | 483 | /* |
482 | * ioctl commands that replace IRIX syssgi()'s | 484 | * ioctl commands that replace IRIX syssgi()'s |
diff --git a/fs/xfs/xfs_types.h b/fs/xfs/xfs_types.h index e4bf711e48ff..16f5371ce102 100644 --- a/fs/xfs/xfs_types.h +++ b/fs/xfs/xfs_types.h | |||
@@ -55,7 +55,7 @@ typedef signed long long int __int64_t; | |||
55 | typedef unsigned long long int __uint64_t; | 55 | typedef unsigned long long int __uint64_t; |
56 | 56 | ||
57 | typedef enum { B_FALSE,B_TRUE } boolean_t; | 57 | typedef enum { B_FALSE,B_TRUE } boolean_t; |
58 | typedef __int64_t prid_t; /* project ID */ | 58 | typedef __uint32_t prid_t; /* project ID */ |
59 | typedef __uint32_t inst_t; /* an instruction */ | 59 | typedef __uint32_t inst_t; /* an instruction */ |
60 | 60 | ||
61 | typedef __s64 xfs_off_t; /* <file offset> type */ | 61 | typedef __s64 xfs_off_t; /* <file offset> type */ |