]> git.apps.os.sepia.ceph.com Git - xfsprogs-dev.git/commit
xfs: cleanup fdblock/frextent accounting in xfs_bmap_del_extent_delay
authorChristoph Hellwig <hch@lst.de>
Mon, 29 Jul 2024 23:22:42 +0000 (16:22 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 30 Jul 2024 00:01:01 +0000 (17:01 -0700)
commit15f2811c84bd2344f3ae59a04f0a55a6ce84a173
treed8024293f1745c4c7dedaadbf5af0bf7775848d6
parent497b0097b2da7431477acfffbaf2ca6e40da483b
xfs: cleanup fdblock/frextent accounting in xfs_bmap_del_extent_delay

Source kernel commit: 7e77d57a1fea5f6bfe166210385ba9f227a606d1

The code to account fdblocks and frextents in xfs_bmap_del_extent_delay
is a bit weird in that it accounts frextents before the iext tree
manipulations and fdblocks after it.  Given that the iext tree
manipulations cannot fail currently that's not really a problem, but
still odd.  Move the frextent manipulation to the end, and use a
fdblocks variable to account of the unconditional indirect blocks and
the data blocks only freed for !RT.  This prepares for following
updates in the area and already makes the code more readable.

Also remove the !isrt assert given that this code clearly handles
rt extents correctly, and we'll soon reinstate delalloc support for
RT inodes.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
libxfs/xfs_bmap.c