]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
libxfs: use helpers to convert rt block numbers to rt extent numbers
authorDarrick J. Wong <djwong@kernel.org>
Mon, 15 Apr 2024 23:07:28 +0000 (16:07 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Wed, 17 Apr 2024 21:06:23 +0000 (14:06 -0700)
Now that we have helpers to do unit conversions of rt block numbers to
rt extent numbers, plug that into libxfs.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bill O'Donnell <bodonnel@redhat.com>
libxfs/trans.c

index a05111bf63c428b0cebd7f799d3f8284a11e16c6..bd1186b24e628074efd6ddc2605f9c4e906849cb 100644 (file)
@@ -19,6 +19,7 @@
 #include "xfs_sb.h"
 #include "xfs_defer.h"
 #include "xfs_trace.h"
+#include "xfs_rtbitmap.h"
 
 static void xfs_trans_free_items(struct xfs_trans *tp);
 STATIC struct xfs_trans *xfs_trans_dup(struct xfs_trans *tp);
@@ -1131,7 +1132,7 @@ libxfs_trans_alloc_inode(
        int                     error;
 
        error = libxfs_trans_alloc(mp, resv, dblocks,
-                       rblocks / mp->m_sb.sb_rextsize,
+                       xfs_rtb_to_rtx(mp, rblocks),
                        force ? XFS_TRANS_RESERVE : 0, &tp);
        if (error)
                return error;