From: Nathan Scott Date: Mon, 20 Jun 2005 03:47:26 +0000 (+0000) Subject: Switch to using fsxattr instead of special projid ioctls. X-Git-Tag: v2.7.0~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c6d388db55844d15065c6937af8099c362c5f45;p=thirdparty%2Fxfsprogs-dev.git Switch to using fsxattr instead of special projid ioctls. Merge of master-melb:xfs-cmds:22902a by kenmcd. --- diff --git a/include/xfs_fs.h b/include/xfs_fs.h index a7bd4687f..095af0a5c 100644 --- a/include/xfs_fs.h +++ b/include/xfs_fs.h @@ -60,7 +60,8 @@ struct fsxattr { __u32 fsx_xflags; /* xflags field value (get/set) */ __u32 fsx_extsize; /* extsize field value (get/set)*/ __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 @@ -477,8 +478,6 @@ typedef struct xfs_handle { /* XFS_IOC_SETBIOSIZE ---- deprecated 46 */ /* XFS_IOC_GETBIOSIZE ---- deprecated 47 */ #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 diff --git a/libxcmd/projects.c b/libxcmd/projects.c index 18e723155..35cbb11ab 100644 --- a/libxcmd/projects.c +++ b/libxcmd/projects.c @@ -196,10 +196,12 @@ getprojid( } *projid = st.st_projid; #else - if (xfsctl(name, fd, XFS_IOC_GETPROJID, projid)) { - perror("XFS_IOC_GETPROJID"); + struct fsxattr fsx; + if (xfsctl(name, fd, XFS_IOC_FSGETXATTR, &fsx)) { + perror("XFS_IOC_FSGETXATTR"); return -1; } + *projid = fsx.fsx_projid; #endif return 0; } @@ -213,6 +215,13 @@ setprojid( #if defined(__sgi__) return fchproj(fd, projid); #else - return xfsctl(name, fd, XFS_IOC_SETPROJID, &projid); + struct fsxattr fsx; + int error; + + if ((error = xfsctl(name, fd, XFS_IOC_FSGETXATTR, &fsx)) == 0) { + fsx.fsx_projid = projid; + error = xfsctl(name, fd, XFS_IOC_FSSETXATTR, &fsx); + } + return error; #endif }