]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: track the iunlink list pointer in the xfs_inode
authorDave Chinner <dchinner@redhat.com>
Wed, 24 Aug 2022 14:22:16 +0000 (16:22 +0200)
committerCarlos Maiolino <cem@kernel.org>
Tue, 30 Aug 2022 08:27:40 +0000 (10:27 +0200)
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 <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
include/xfs_inode.h
libxfs/xfs_inode_buf.c

index d160cedf4ecd2abfef9a1014390a2ae708c4aa10..b0bba1094e725475620dfd036019494ebc057423 100644 (file)
@@ -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 */
 
index e8283e0d77d7fb430ee5837a5691aa5edd59db20..cbcaadbcf69cb1f090781886b1d8fc945cd58975 100644 (file)
@@ -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);