]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
xfs: opencode xfs_zone_record_blocks
authorCarlos Maiolino <cem@kernel.org>
Tue, 10 Mar 2026 17:36:49 +0000 (18:36 +0100)
committerCarlos Maiolino <cem@kernel.org>
Wed, 18 Mar 2026 08:33:52 +0000 (09:33 +0100)
We only have a single caller, no need to keep it in its own function.

Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
[hch: add zone_record_blocks trace back]
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_zone_alloc.c

index 97149bfc2512487b652daff7960973deb0dc36a4..9d02160c5334830044222afdfc21c7754b249fbb 100644 (file)
@@ -201,27 +201,6 @@ xfs_zone_inc_written(
                xfs_open_zone_mark_full(oz);
 }
 
-static void
-xfs_zone_record_blocks(
-       struct xfs_trans        *tp,
-       struct xfs_open_zone    *oz,
-       xfs_fsblock_t           fsbno,
-       xfs_filblks_t           len)
-{
-       struct xfs_mount        *mp = tp->t_mountp;
-       struct xfs_rtgroup      *rtg = oz->oz_rtg;
-       struct xfs_inode        *rmapip = rtg_rmap(rtg);
-
-       trace_xfs_zone_record_blocks(oz, xfs_rtb_to_rgbno(mp, fsbno), len);
-
-       xfs_rtgroup_lock(rtg, XFS_RTGLOCK_RMAP);
-       xfs_rtgroup_trans_join(tp, rtg, XFS_RTGLOCK_RMAP);
-       rmapip->i_used_blocks += len;
-       ASSERT(rmapip->i_used_blocks <= rtg_blocks(rtg));
-       xfs_zone_inc_written(oz, len);
-       xfs_trans_log_inode(tp, rmapip, XFS_ILOG_CORE);
-}
-
 /*
  * Called for blocks that have been written to disk, but not actually linked to
  * an inode, which can happen when garbage collection races with user data
@@ -252,6 +231,8 @@ xfs_zoned_map_extent(
        xfs_fsblock_t           old_startblock)
 {
        struct xfs_bmbt_irec    data;
+       struct xfs_rtgroup      *rtg = oz->oz_rtg;
+       struct xfs_inode        *rmapip = rtg_rmap(rtg);
        int                     nmaps = 1;
        int                     error;
 
@@ -310,7 +291,15 @@ xfs_zoned_map_extent(
                }
        }
 
-       xfs_zone_record_blocks(tp, oz, new->br_startblock, new->br_blockcount);
+       trace_xfs_zone_record_blocks(oz,
+               xfs_rtb_to_rgbno(tp->t_mountp, new->br_startblock),
+               new->br_blockcount);
+       xfs_rtgroup_lock(rtg, XFS_RTGLOCK_RMAP);
+       xfs_rtgroup_trans_join(tp, rtg, XFS_RTGLOCK_RMAP);
+       rmapip->i_used_blocks += new->br_blockcount;
+       ASSERT(rmapip->i_used_blocks <= rtg_blocks(rtg));
+       xfs_zone_inc_written(oz, new->br_blockcount);
+       xfs_trans_log_inode(tp, rmapip, XFS_ILOG_CORE);
 
        /* Map the new blocks into the data fork. */
        xfs_bmap_map_extent(tp, ip, XFS_DATA_FORK, new);