提交 39058a0e 编写于 作者: E Eric Sandeen 提交者: Tim Shimmin

[XFS] Clean up use of VFS attr flags

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: NEric Sandeen <sandeen@sandeen.net>
Signed-off-by: NDavid Chinner <dgc@sgi.com>
Signed-off-by: NChristoph Hellwig <hch@infradead.org>
Signed-off-by: NTim Shimmin <tes@sgi.com>
上级 4cf3b520
...@@ -1090,11 +1090,6 @@ xfs_ioc_fsgeometry( ...@@ -1090,11 +1090,6 @@ xfs_ioc_fsgeometry(
/* /*
* Linux extended inode flags interface. * 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 STATIC unsigned int
xfs_merge_ioc_xflags( xfs_merge_ioc_xflags(
...@@ -1103,23 +1098,23 @@ xfs_merge_ioc_xflags( ...@@ -1103,23 +1098,23 @@ xfs_merge_ioc_xflags(
{ {
unsigned int xflags = start; unsigned int xflags = start;
if (flags & LINUX_XFLAG_IMMUTABLE) if (flags & FS_IMMUTABLE_FL)
xflags |= XFS_XFLAG_IMMUTABLE; xflags |= XFS_XFLAG_IMMUTABLE;
else else
xflags &= ~XFS_XFLAG_IMMUTABLE; xflags &= ~XFS_XFLAG_IMMUTABLE;
if (flags & LINUX_XFLAG_APPEND) if (flags & FS_APPEND_FL)
xflags |= XFS_XFLAG_APPEND; xflags |= XFS_XFLAG_APPEND;
else else
xflags &= ~XFS_XFLAG_APPEND; xflags &= ~XFS_XFLAG_APPEND;
if (flags & LINUX_XFLAG_SYNC) if (flags & FS_SYNC_FL)
xflags |= XFS_XFLAG_SYNC; xflags |= XFS_XFLAG_SYNC;
else else
xflags &= ~XFS_XFLAG_SYNC; xflags &= ~XFS_XFLAG_SYNC;
if (flags & LINUX_XFLAG_NOATIME) if (flags & FS_NOATIME_FL)
xflags |= XFS_XFLAG_NOATIME; xflags |= XFS_XFLAG_NOATIME;
else else
xflags &= ~XFS_XFLAG_NOATIME; xflags &= ~XFS_XFLAG_NOATIME;
if (flags & LINUX_XFLAG_NODUMP) if (flags & FS_NODUMP_FL)
xflags |= XFS_XFLAG_NODUMP; xflags |= XFS_XFLAG_NODUMP;
else else
xflags &= ~XFS_XFLAG_NODUMP; xflags &= ~XFS_XFLAG_NODUMP;
...@@ -1134,15 +1129,15 @@ xfs_di2lxflags( ...@@ -1134,15 +1129,15 @@ xfs_di2lxflags(
unsigned int flags = 0; unsigned int flags = 0;
if (di_flags & XFS_DIFLAG_IMMUTABLE) if (di_flags & XFS_DIFLAG_IMMUTABLE)
flags |= LINUX_XFLAG_IMMUTABLE; flags |= FS_IMMUTABLE_FL;
if (di_flags & XFS_DIFLAG_APPEND) if (di_flags & XFS_DIFLAG_APPEND)
flags |= LINUX_XFLAG_APPEND; flags |= FS_APPEND_FL;
if (di_flags & XFS_DIFLAG_SYNC) if (di_flags & XFS_DIFLAG_SYNC)
flags |= LINUX_XFLAG_SYNC; flags |= FS_SYNC_FL;
if (di_flags & XFS_DIFLAG_NOATIME) if (di_flags & XFS_DIFLAG_NOATIME)
flags |= LINUX_XFLAG_NOATIME; flags |= FS_NOATIME_FL;
if (di_flags & XFS_DIFLAG_NODUMP) if (di_flags & XFS_DIFLAG_NODUMP)
flags |= LINUX_XFLAG_NODUMP; flags |= FS_NODUMP_FL;
return flags; return flags;
} }
...@@ -1242,9 +1237,9 @@ xfs_ioc_xattr( ...@@ -1242,9 +1237,9 @@ xfs_ioc_xattr(
break; break;
} }
if (flags & ~(LINUX_XFLAG_IMMUTABLE | LINUX_XFLAG_APPEND | \ if (flags & ~(FS_IMMUTABLE_FL | FS_APPEND_FL | \
LINUX_XFLAG_NOATIME | LINUX_XFLAG_NODUMP | \ FS_NOATIME_FL | FS_NODUMP_FL | \
LINUX_XFLAG_SYNC)) { FS_SYNC_FL)) {
error = -EOPNOTSUPP; error = -EOPNOTSUPP;
break; break;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册