[XFS] Clean up use of VFS attr flags
authorEric Sandeen <sandeen@sandeen.net>
Sat, 10 Feb 2007 07:37:10 +0000 (18:37 +1100)
committerTim Shimmin <tes@sgi.com>
Sat, 10 Feb 2007 07:37:10 +0000 (18:37 +1100)
Use the the generic VFS attr flags where appropriate instead of open
coding them to the same values.

Patch provided by Eric Sandeen.

SGI-PV: 960868
SGI-Modid: xfs-linux-melb:xfs-kern:28033a

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Tim Shimmin <tes@sgi.com>
fs/xfs/linux-2.6/xfs_ioctl.c

index 59b5c9b21ed73cf798b676dc88e622b580783990..e9d920d4a659a8bc85b12ede7e161c759b76c0d0 100644 (file)
@@ -1090,11 +1090,6 @@ xfs_ioc_fsgeometry(
 /*
  * Linux extended inode flags interface.
  */
-#define LINUX_XFLAG_SYNC       0x00000008 /* Synchronous updates */
-#define LINUX_XFLAG_IMMUTABLE  0x00000010 /* Immutable file */
-#define LINUX_XFLAG_APPEND     0x00000020 /* writes to file may only append */
-#define LINUX_XFLAG_NODUMP     0x00000040 /* do not dump file */
-#define LINUX_XFLAG_NOATIME    0x00000080 /* do not update atime */
 
 STATIC unsigned int
 xfs_merge_ioc_xflags(
@@ -1103,23 +1098,23 @@ xfs_merge_ioc_xflags(
 {
        unsigned int    xflags = start;
 
-       if (flags & LINUX_XFLAG_IMMUTABLE)
+       if (flags & FS_IMMUTABLE_FL)
                xflags |= XFS_XFLAG_IMMUTABLE;
        else
                xflags &= ~XFS_XFLAG_IMMUTABLE;
-       if (flags & LINUX_XFLAG_APPEND)
+       if (flags & FS_APPEND_FL)
                xflags |= XFS_XFLAG_APPEND;
        else
                xflags &= ~XFS_XFLAG_APPEND;
-       if (flags & LINUX_XFLAG_SYNC)
+       if (flags & FS_SYNC_FL)
                xflags |= XFS_XFLAG_SYNC;
        else
                xflags &= ~XFS_XFLAG_SYNC;
-       if (flags & LINUX_XFLAG_NOATIME)
+       if (flags & FS_NOATIME_FL)
                xflags |= XFS_XFLAG_NOATIME;
        else
                xflags &= ~XFS_XFLAG_NOATIME;
-       if (flags & LINUX_XFLAG_NODUMP)
+       if (flags & FS_NODUMP_FL)
                xflags |= XFS_XFLAG_NODUMP;
        else
                xflags &= ~XFS_XFLAG_NODUMP;
@@ -1134,15 +1129,15 @@ xfs_di2lxflags(
        unsigned int    flags = 0;
 
        if (di_flags & XFS_DIFLAG_IMMUTABLE)
-               flags |= LINUX_XFLAG_IMMUTABLE;
+               flags |= FS_IMMUTABLE_FL;
        if (di_flags & XFS_DIFLAG_APPEND)
-               flags |= LINUX_XFLAG_APPEND;
+               flags |= FS_APPEND_FL;
        if (di_flags & XFS_DIFLAG_SYNC)
-               flags |= LINUX_XFLAG_SYNC;
+               flags |= FS_SYNC_FL;
        if (di_flags & XFS_DIFLAG_NOATIME)
-               flags |= LINUX_XFLAG_NOATIME;
+               flags |= FS_NOATIME_FL;
        if (di_flags & XFS_DIFLAG_NODUMP)
-               flags |= LINUX_XFLAG_NODUMP;
+               flags |= FS_NODUMP_FL;
        return flags;
 }
 
@@ -1242,9 +1237,9 @@ xfs_ioc_xattr(
                        break;
                }
 
-               if (flags & ~(LINUX_XFLAG_IMMUTABLE | LINUX_XFLAG_APPEND | \
-                             LINUX_XFLAG_NOATIME | LINUX_XFLAG_NODUMP | \
-                             LINUX_XFLAG_SYNC)) {
+               if (flags & ~(FS_IMMUTABLE_FL | FS_APPEND_FL | \
+                             FS_NOATIME_FL | FS_NODUMP_FL | \
+                             FS_SYNC_FL)) {
                        error = -EOPNOTSUPP;
                        break;
                }