@@ -832,35 +832,31 @@ xfs_ioc_ag_geometry(
* Linux extended inode flags interface.
*/
-STATIC unsigned int
+static inline void
xfs_merge_ioc_xflags(
- unsigned int flags,
- unsigned int start)
+ struct fsxattr *fa,
+ unsigned int flags)
{
- unsigned int xflags = start;
-
if (flags & FS_IMMUTABLE_FL)
- xflags |= FS_XFLAG_IMMUTABLE;
+ fa->fsx_xflags |= FS_XFLAG_IMMUTABLE;
else
- xflags &= ~FS_XFLAG_IMMUTABLE;
+ fa->fsx_xflags &= ~FS_XFLAG_IMMUTABLE;
if (flags & FS_APPEND_FL)
- xflags |= FS_XFLAG_APPEND;
+ fa->fsx_xflags |= FS_XFLAG_APPEND;
else
- xflags &= ~FS_XFLAG_APPEND;
+ fa->fsx_xflags &= ~FS_XFLAG_APPEND;
if (flags & FS_SYNC_FL)
- xflags |= FS_XFLAG_SYNC;
+ fa->fsx_xflags |= FS_XFLAG_SYNC;
else
- xflags &= ~FS_XFLAG_SYNC;
+ fa->fsx_xflags &= ~FS_XFLAG_SYNC;
if (flags & FS_NOATIME_FL)
- xflags |= FS_XFLAG_NOATIME;
+ fa->fsx_xflags |= FS_XFLAG_NOATIME;
else
- xflags &= ~FS_XFLAG_NOATIME;
+ fa->fsx_xflags &= ~FS_XFLAG_NOATIME;
if (flags & FS_NODUMP_FL)
- xflags |= FS_XFLAG_NODUMP;
+ fa->fsx_xflags |= FS_XFLAG_NODUMP;
else
- xflags &= ~FS_XFLAG_NODUMP;
-
- return xflags;
+ fa->fsx_xflags &= ~FS_XFLAG_NODUMP;
}
STATIC unsigned int
@@ -1549,7 +1545,7 @@ xfs_ioc_setxflags(
return -EOPNOTSUPP;
xfs_inode_getfsxattr(ip, false, &fa);
- fa.fsx_xflags = xfs_merge_ioc_xflags(flags, fa.fsx_xflags);
+ xfs_merge_ioc_xflags(&fa, flags);
error = mnt_want_write_file(filp);
if (error)