mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-10 07:00:48 +00:00
xfs: merge _xfs_dic2xflags into xfs_ip2xflags
Merge _xfs_dic2xflags into its only caller. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
This commit is contained in:
parent
e98d5e882b
commit
4422501da6
@ -598,63 +598,53 @@ xfs_lock_two_inodes(
|
||||
}
|
||||
}
|
||||
|
||||
STATIC uint
|
||||
_xfs_dic2xflags(
|
||||
uint16_t di_flags,
|
||||
uint64_t di_flags2,
|
||||
bool has_attr)
|
||||
{
|
||||
uint flags = 0;
|
||||
|
||||
if (di_flags & XFS_DIFLAG_ANY) {
|
||||
if (di_flags & XFS_DIFLAG_REALTIME)
|
||||
flags |= FS_XFLAG_REALTIME;
|
||||
if (di_flags & XFS_DIFLAG_PREALLOC)
|
||||
flags |= FS_XFLAG_PREALLOC;
|
||||
if (di_flags & XFS_DIFLAG_IMMUTABLE)
|
||||
flags |= FS_XFLAG_IMMUTABLE;
|
||||
if (di_flags & XFS_DIFLAG_APPEND)
|
||||
flags |= FS_XFLAG_APPEND;
|
||||
if (di_flags & XFS_DIFLAG_SYNC)
|
||||
flags |= FS_XFLAG_SYNC;
|
||||
if (di_flags & XFS_DIFLAG_NOATIME)
|
||||
flags |= FS_XFLAG_NOATIME;
|
||||
if (di_flags & XFS_DIFLAG_NODUMP)
|
||||
flags |= FS_XFLAG_NODUMP;
|
||||
if (di_flags & XFS_DIFLAG_RTINHERIT)
|
||||
flags |= FS_XFLAG_RTINHERIT;
|
||||
if (di_flags & XFS_DIFLAG_PROJINHERIT)
|
||||
flags |= FS_XFLAG_PROJINHERIT;
|
||||
if (di_flags & XFS_DIFLAG_NOSYMLINKS)
|
||||
flags |= FS_XFLAG_NOSYMLINKS;
|
||||
if (di_flags & XFS_DIFLAG_EXTSIZE)
|
||||
flags |= FS_XFLAG_EXTSIZE;
|
||||
if (di_flags & XFS_DIFLAG_EXTSZINHERIT)
|
||||
flags |= FS_XFLAG_EXTSZINHERIT;
|
||||
if (di_flags & XFS_DIFLAG_NODEFRAG)
|
||||
flags |= FS_XFLAG_NODEFRAG;
|
||||
if (di_flags & XFS_DIFLAG_FILESTREAM)
|
||||
flags |= FS_XFLAG_FILESTREAM;
|
||||
}
|
||||
|
||||
if (di_flags2 & XFS_DIFLAG2_ANY) {
|
||||
if (di_flags2 & XFS_DIFLAG2_DAX)
|
||||
flags |= FS_XFLAG_DAX;
|
||||
if (di_flags2 & XFS_DIFLAG2_COWEXTSIZE)
|
||||
flags |= FS_XFLAG_COWEXTSIZE;
|
||||
}
|
||||
|
||||
if (has_attr)
|
||||
flags |= FS_XFLAG_HASATTR;
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
uint
|
||||
xfs_ip2xflags(
|
||||
struct xfs_inode *ip)
|
||||
{
|
||||
return _xfs_dic2xflags(ip->i_diflags, ip->i_diflags2, XFS_IFORK_Q(ip));
|
||||
uint flags = 0;
|
||||
|
||||
if (ip->i_diflags & XFS_DIFLAG_ANY) {
|
||||
if (ip->i_diflags & XFS_DIFLAG_REALTIME)
|
||||
flags |= FS_XFLAG_REALTIME;
|
||||
if (ip->i_diflags & XFS_DIFLAG_PREALLOC)
|
||||
flags |= FS_XFLAG_PREALLOC;
|
||||
if (ip->i_diflags & XFS_DIFLAG_IMMUTABLE)
|
||||
flags |= FS_XFLAG_IMMUTABLE;
|
||||
if (ip->i_diflags & XFS_DIFLAG_APPEND)
|
||||
flags |= FS_XFLAG_APPEND;
|
||||
if (ip->i_diflags & XFS_DIFLAG_SYNC)
|
||||
flags |= FS_XFLAG_SYNC;
|
||||
if (ip->i_diflags & XFS_DIFLAG_NOATIME)
|
||||
flags |= FS_XFLAG_NOATIME;
|
||||
if (ip->i_diflags & XFS_DIFLAG_NODUMP)
|
||||
flags |= FS_XFLAG_NODUMP;
|
||||
if (ip->i_diflags & XFS_DIFLAG_RTINHERIT)
|
||||
flags |= FS_XFLAG_RTINHERIT;
|
||||
if (ip->i_diflags & XFS_DIFLAG_PROJINHERIT)
|
||||
flags |= FS_XFLAG_PROJINHERIT;
|
||||
if (ip->i_diflags & XFS_DIFLAG_NOSYMLINKS)
|
||||
flags |= FS_XFLAG_NOSYMLINKS;
|
||||
if (ip->i_diflags & XFS_DIFLAG_EXTSIZE)
|
||||
flags |= FS_XFLAG_EXTSIZE;
|
||||
if (ip->i_diflags & XFS_DIFLAG_EXTSZINHERIT)
|
||||
flags |= FS_XFLAG_EXTSZINHERIT;
|
||||
if (ip->i_diflags & XFS_DIFLAG_NODEFRAG)
|
||||
flags |= FS_XFLAG_NODEFRAG;
|
||||
if (ip->i_diflags & XFS_DIFLAG_FILESTREAM)
|
||||
flags |= FS_XFLAG_FILESTREAM;
|
||||
}
|
||||
|
||||
if (ip->i_diflags2 & XFS_DIFLAG2_ANY) {
|
||||
if (ip->i_diflags2 & XFS_DIFLAG2_DAX)
|
||||
flags |= FS_XFLAG_DAX;
|
||||
if (ip->i_diflags2 & XFS_DIFLAG2_COWEXTSIZE)
|
||||
flags |= FS_XFLAG_COWEXTSIZE;
|
||||
}
|
||||
|
||||
if (XFS_IFORK_Q(ip))
|
||||
flags |= FS_XFLAG_HASATTR;
|
||||
return flags;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user