[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: 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>
This commit is contained in:
parent
4cf3b52080
commit
39058a0e12
1 changed files with 13 additions and 18 deletions
|
@ -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(
|
||||||
{
|
{
|
||||||
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(
|
||||||
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(
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue