Commit b3d1d375 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Darrick J. Wong

xfs: simplify di_flags2 inheritance in xfs_ialloc

di_flags2 is initialized to zero for v4 and earlier file systems.  This
means di_flags2 can only be non-zero for a v5 file systems, in which
case both the parent and child inodes can store the field.  Remove the
extra di_version check, and also remove the rather pointless local
di_flags2 variable while at it.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
Reviewed-by: default avatarChandan Rajendra <chandanrlinux@gmail.com>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
parent e9e2eae8
...@@ -907,20 +907,13 @@ xfs_ialloc( ...@@ -907,20 +907,13 @@ xfs_ialloc(
ip->i_d.di_flags |= di_flags; ip->i_d.di_flags |= di_flags;
} }
if (pip && if (pip && (pip->i_d.di_flags2 & XFS_DIFLAG2_ANY)) {
(pip->i_d.di_flags2 & XFS_DIFLAG2_ANY) &&
pip->i_d.di_version == 3 &&
ip->i_d.di_version == 3) {
uint64_t di_flags2 = 0;
if (pip->i_d.di_flags2 & XFS_DIFLAG2_COWEXTSIZE) { if (pip->i_d.di_flags2 & XFS_DIFLAG2_COWEXTSIZE) {
di_flags2 |= XFS_DIFLAG2_COWEXTSIZE; ip->i_d.di_flags2 |= XFS_DIFLAG2_COWEXTSIZE;
ip->i_d.di_cowextsize = pip->i_d.di_cowextsize; ip->i_d.di_cowextsize = pip->i_d.di_cowextsize;
} }
if (pip->i_d.di_flags2 & XFS_DIFLAG2_DAX) if (pip->i_d.di_flags2 & XFS_DIFLAG2_DAX)
di_flags2 |= XFS_DIFLAG2_DAX; ip->i_d.di_flags2 |= XFS_DIFLAG2_DAX;
ip->i_d.di_flags2 |= di_flags2;
} }
/* FALLTHROUGH */ /* FALLTHROUGH */
case S_IFLNK: case S_IFLNK:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment