From: Dave Chinner Date: Wed, 24 Aug 2022 14:22:16 +0000 (+0200) Subject: xfs: track the iunlink list pointer in the xfs_inode X-Git-Tag: v6.0.0-rc0~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=69535dadf8222204726e97c79d26e6a85f3f0570;p=thirdparty%2Fxfsprogs-dev.git xfs: track the iunlink list pointer in the xfs_inode Source kernel commit: 4fcc94d653270fcc7800dbaf3b11f78cb462b293 Having direct access to the i_next_unlinked pointer in unlinked inodes greatly simplifies the processing of inodes on the unlinked list. We no longer need to look up the inode buffer just to find next inode in the list if the xfs_inode is in memory. These improvements will be realised over upcoming patches as other dependencies on the inode buffer for unlinked list processing are removed. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Carlos Maiolino --- diff --git a/include/xfs_inode.h b/include/xfs_inode.h index d160cedf4..b0bba1094 100644 --- a/include/xfs_inode.h +++ b/include/xfs_inode.h @@ -93,6 +93,9 @@ typedef struct xfs_inode { uint64_t i_diflags2; /* XFS_DIFLAG2_... */ struct timespec64 i_crtime; /* time created */ + /* unlinked list pointers */ + xfs_agino_t i_next_unlinked; + xfs_extnum_t i_cnextents; /* # of extents in cow fork */ unsigned int i_cformat; /* format of cow fork */ diff --git a/libxfs/xfs_inode_buf.c b/libxfs/xfs_inode_buf.c index e8283e0d7..cbcaadbcf 100644 --- a/libxfs/xfs_inode_buf.c +++ b/libxfs/xfs_inode_buf.c @@ -225,7 +225,8 @@ xfs_inode_from_disk( ip->i_nblocks = be64_to_cpu(from->di_nblocks); ip->i_extsize = be32_to_cpu(from->di_extsize); ip->i_forkoff = from->di_forkoff; - ip->i_diflags = be16_to_cpu(from->di_flags); + ip->i_diflags = be16_to_cpu(from->di_flags); + ip->i_next_unlinked = be32_to_cpu(from->di_next_unlinked); if (from->di_dmevmask || from->di_dmstate) xfs_iflags_set(ip, XFS_IPRESERVE_DM_FIELDS);