]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
Switch to using fsxattr instead of special projid ioctls.
authorNathan Scott <nathans@sgi.com>
Mon, 20 Jun 2005 03:47:26 +0000 (03:47 +0000)
committerNathan Scott <nathans@sgi.com>
Mon, 20 Jun 2005 03:47:26 +0000 (03:47 +0000)
Merge of master-melb:xfs-cmds:22902a by kenmcd.

include/xfs_fs.h
libxcmd/projects.c

index a7bd4687fa50bfcf39597cd12256a5cd399b8cfd..095af0a5cff3bc50a4420d81e65ef8ed2b7ae710 100644 (file)
@@ -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
index 18e723155f81e3db3f685488e408c0ef50d927ba..35cbb11ab0aff4debfcfe1090cde4a7f677e7777 100644 (file)
@@ -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
 }