summaryrefslogtreecommitdiff
path: root/fs/xfs/linux-2.6
diff options
context:
space:
mode:
authorNathan Scott <nathans@sgi.com>2005-06-21 07:21:49 +0400
committerNathan Scott <nathans@sgi.com>2005-06-21 07:21:49 +0400
commitb74e2159c9849fb97659c6dc47ad706f702b22b9 (patch)
treea2fd0ade921c483b10aee42be2c3b30ceb2c02c7 /fs/xfs/linux-2.6
parent91b90475e793e84a57d956af8c52645e292badcb (diff)
downloadlinux-b74e2159c9849fb97659c6dc47ad706f702b22b9.tar.xz
[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')
-rw-r--r--fs/xfs/linux-2.6/xfs_ioctl.c22
-rw-r--r--fs/xfs/linux-2.6/xfs_ioctl32.c2
-rw-r--r--fs/xfs/linux-2.6/xfs_vnode.h2
3 files changed, 25 insertions, 1 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(
case XFS_IOC_GETVERSION:
case XFS_IOC_GETXFLAGS:
case XFS_IOC_SETXFLAGS:
+ case XFS_IOC_GETPROJID:
+ case XFS_IOC_SETPROJID:
case XFS_IOC_FSGETXATTR:
case XFS_IOC_FSSETXATTR:
case XFS_IOC_FSGETXATTRA:
@@ -1258,6 +1260,26 @@ xfs_ioc_xattr(
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:
return -ENOTTY;
}
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)
case XFS_IOC_GETBMAP:
case XFS_IOC_GETBMAPA:
case XFS_IOC_GETBMAPX:
+ case XFS_IOC_SETPROJID:
+ case XFS_IOC_GETPROJID:
/* not handled
case XFS_IOC_FD_TO_HANDLE:
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 {
u_long va_extsize; /* file extent size */
u_long va_nextents; /* number of extents in file */
u_long va_anextents; /* number of attr extents in file */
- int va_projid; /* project id */
+ prid_t va_projid; /* project id */
} vattr_t;
/*