From: Christoph Hellwig Date: Wed, 30 Jun 2021 22:29:44 +0000 (-0400) Subject: xfs: remove the di_dmevmask and di_dmstate fields from struct xfs_icdinode X-Git-Tag: v5.13.0-rc0~37 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ed6a34291b7bd9f62ee6d8b2bcf343c9473b4bcd;p=thirdparty%2Fxfsprogs-dev.git xfs: remove the di_dmevmask and di_dmstate fields from struct xfs_icdinode Source kernel commit: 9b3beb028ff5bed99473021d1a7de8747665ac32 The legacy DMAPI fields were never set by upstream Linux XFS, and have no way to be read using the kernel APIs. So instead of bloating the in-core inode for them just copy them from the on-disk inode into the log when logging the inode. The only caveat is that we need to make sure to zero the fields for newly read or deleted inodes, which is solved using a new flag in the inode. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Signed-off-by: Eric Sandeen --- diff --git a/libxfs/libxfs_priv.h b/libxfs/libxfs_priv.h index e37d5933f..fb8cb6771 100644 --- a/libxfs/libxfs_priv.h +++ b/libxfs/libxfs_priv.h @@ -700,4 +700,7 @@ int xfs_bmap_last_extent(struct xfs_trans *tp, struct xfs_inode *ip, int whichfork, struct xfs_bmbt_irec *rec, int *is_empty); +/* xfs_inode.h */ +#define xfs_iflags_set(ip, flags) do { } while (0) + #endif /* __LIBXFS_INTERNAL_XFS_H__ */ diff --git a/libxfs/util.c b/libxfs/util.c index a49aee9e7..c666ee88c 100644 --- a/libxfs/util.c +++ b/libxfs/util.c @@ -280,8 +280,6 @@ libxfs_init_new_inode( ip->i_df.if_nextents = 0; ASSERT(ip->i_d.di_nblocks == 0); ip->i_d.di_extsize = pip ? 0 : fsx->fsx_extsize; - ip->i_d.di_dmevmask = 0; - ip->i_d.di_dmstate = 0; ip->i_d.di_flags = pip ? 0 : xfs_flags2diflags(ip, fsx->fsx_xflags); if (xfs_sb_version_has_v3inode(&ip->i_mount->m_sb)) { diff --git a/libxfs/xfs_inode_buf.c b/libxfs/xfs_inode_buf.c index babab3f96..c7be54a29 100644 --- a/libxfs/xfs_inode_buf.c +++ b/libxfs/xfs_inode_buf.c @@ -227,10 +227,11 @@ xfs_inode_from_disk( to->di_nblocks = be64_to_cpu(from->di_nblocks); to->di_extsize = be32_to_cpu(from->di_extsize); to->di_forkoff = from->di_forkoff; - to->di_dmevmask = be32_to_cpu(from->di_dmevmask); - to->di_dmstate = be16_to_cpu(from->di_dmstate); to->di_flags = be16_to_cpu(from->di_flags); + if (from->di_dmevmask || from->di_dmstate) + xfs_iflags_set(ip, XFS_IPRESERVE_DM_FIELDS); + if (xfs_sb_version_has_v3inode(&ip->i_mount->m_sb)) { inode_set_iversion_queried(inode, be64_to_cpu(from->di_changecount)); @@ -308,8 +309,6 @@ xfs_inode_to_disk( to->di_anextents = cpu_to_be16(xfs_ifork_nextents(ip->i_afp)); to->di_forkoff = from->di_forkoff; to->di_aformat = xfs_ifork_format(ip->i_afp); - to->di_dmevmask = cpu_to_be32(from->di_dmevmask); - to->di_dmstate = cpu_to_be16(from->di_dmstate); to->di_flags = cpu_to_be16(from->di_flags); if (xfs_sb_version_has_v3inode(&ip->i_mount->m_sb)) { diff --git a/libxfs/xfs_inode_buf.h b/libxfs/xfs_inode_buf.h index b3097ea8b..d7a019df0 100644 --- a/libxfs/xfs_inode_buf.h +++ b/libxfs/xfs_inode_buf.h @@ -22,8 +22,6 @@ struct xfs_icdinode { xfs_rfsblock_t di_nblocks; /* # of direct & btree blocks used */ xfs_extlen_t di_extsize; /* basic/minimum extent size for file */ uint8_t di_forkoff; /* attr fork offs, <<3 for 64b align */ - uint32_t di_dmevmask; /* DMIG event mask */ - uint16_t di_dmstate; /* DMIG state info */ uint16_t di_flags; /* random flags, XFS_DIFLAG_... */ uint64_t di_flags2; /* more random flags */