]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: rename xfs_*alloc*_log_count to _block_count
authorDarrick J. Wong <djwong@kernel.org>
Wed, 22 Jun 2022 19:28:52 +0000 (14:28 -0500)
committerEric Sandeen <sandeen@sandeen.net>
Wed, 22 Jun 2022 19:28:52 +0000 (14:28 -0500)
Source kernel commit: 6ed7e509d2304519f4f6741670f512a55e9e80fe

These functions return the maximum number of blocks that could be logged
in a particular transaction.  "log count" is confusing since there's a
separate concept of a log (operation) count in the reservation code, so
let's change it to "block count" to be less confusing.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_refcount.c
libxfs/xfs_trans_resv.c
libxfs/xfs_trans_resv.h

index 371f6083e01e237e01215ce4788592b6d6a9f22c..e5606916a2ac2dd49dd52de9b25c4a8d87155940 100644 (file)
@@ -889,7 +889,7 @@ xfs_refcount_still_have_space(
         * Worst case estimate: full splits of the free space and rmap btrees
         * to handle each of the shape changes to the refcount btree.
         */
-       overhead = xfs_allocfree_log_count(cur->bc_mp,
+       overhead = xfs_allocfree_block_count(cur->bc_mp,
                                cur->bc_ag.refc.shape_changes);
        overhead += cur->bc_mp->m_refc_maxlevels;
        overhead *= cur->bc_mp->m_sb.sb_blocksize;
index a02451add4e034f8e1db632167550d28965ac98f..d4a9f69e681bbf1b166ab3a9d939b029b4702889 100644 (file)
@@ -62,7 +62,7 @@ xfs_calc_buf_res(
  * Keep in mind that max depth is calculated separately for each type of tree.
  */
 uint
-xfs_allocfree_log_count(
+xfs_allocfree_block_count(
        struct xfs_mount *mp,
        uint            num_ops)
 {
@@ -145,7 +145,7 @@ xfs_calc_inobt_res(
 {
        return xfs_calc_buf_res(M_IGEO(mp)->inobt_maxlevels,
                        XFS_FSB_TO_B(mp, 1)) +
-                               xfs_calc_buf_res(xfs_allocfree_log_count(mp, 1),
+                               xfs_calc_buf_res(xfs_allocfree_block_count(mp, 1),
                        XFS_FSB_TO_B(mp, 1));
 }
 
@@ -192,7 +192,7 @@ xfs_calc_inode_chunk_res(
 {
        uint                    res, size = 0;
 
-       res = xfs_calc_buf_res(xfs_allocfree_log_count(mp, 1),
+       res = xfs_calc_buf_res(xfs_allocfree_block_count(mp, 1),
                               XFS_FSB_TO_B(mp, 1));
        if (alloc) {
                /* icreate tx uses ordered buffers */
@@ -212,7 +212,7 @@ xfs_calc_inode_chunk_res(
  * extents, as well as the realtime summary block.
  */
 static unsigned int
-xfs_rtalloc_log_count(
+xfs_rtalloc_block_count(
        struct xfs_mount        *mp,
        unsigned int            num_ops)
 {
@@ -299,21 +299,21 @@ xfs_calc_write_reservation(
        t1 = xfs_calc_inode_res(mp, 1) +
             xfs_calc_buf_res(XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK), blksz) +
             xfs_calc_buf_res(3, mp->m_sb.sb_sectsize) +
-            xfs_calc_buf_res(xfs_allocfree_log_count(mp, 2), blksz);
+            xfs_calc_buf_res(xfs_allocfree_block_count(mp, 2), blksz);
 
        if (xfs_has_realtime(mp)) {
                t2 = xfs_calc_inode_res(mp, 1) +
                     xfs_calc_buf_res(XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK),
                                     blksz) +
                     xfs_calc_buf_res(3, mp->m_sb.sb_sectsize) +
-                    xfs_calc_buf_res(xfs_rtalloc_log_count(mp, 1), blksz) +
-                    xfs_calc_buf_res(xfs_allocfree_log_count(mp, 1), blksz);
+                    xfs_calc_buf_res(xfs_rtalloc_block_count(mp, 1), blksz) +
+                    xfs_calc_buf_res(xfs_allocfree_block_count(mp, 1), blksz);
        } else {
                t2 = 0;
        }
 
        t3 = xfs_calc_buf_res(5, mp->m_sb.sb_sectsize) +
-            xfs_calc_buf_res(xfs_allocfree_log_count(mp, 2), blksz);
+            xfs_calc_buf_res(xfs_allocfree_block_count(mp, 2), blksz);
 
        /*
         * In the early days of reflink, we included enough reservation to log
@@ -380,12 +380,12 @@ xfs_calc_itruncate_reservation(
             xfs_calc_buf_res(XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK) + 1, blksz);
 
        t2 = xfs_calc_buf_res(9, mp->m_sb.sb_sectsize) +
-            xfs_calc_buf_res(xfs_allocfree_log_count(mp, 4), blksz);
+            xfs_calc_buf_res(xfs_allocfree_block_count(mp, 4), blksz);
 
        if (xfs_has_realtime(mp)) {
                t3 = xfs_calc_buf_res(5, mp->m_sb.sb_sectsize) +
-                    xfs_calc_buf_res(xfs_rtalloc_log_count(mp, 2), blksz) +
-                    xfs_calc_buf_res(xfs_allocfree_log_count(mp, 2), blksz);
+                    xfs_calc_buf_res(xfs_rtalloc_block_count(mp, 2), blksz) +
+                    xfs_calc_buf_res(xfs_allocfree_block_count(mp, 2), blksz);
        } else {
                t3 = 0;
        }
@@ -440,7 +440,7 @@ xfs_calc_rename_reservation(
                     xfs_calc_buf_res(2 * XFS_DIROP_LOG_COUNT(mp),
                                      XFS_FSB_TO_B(mp, 1))),
                    (xfs_calc_buf_res(7, mp->m_sb.sb_sectsize) +
-                    xfs_calc_buf_res(xfs_allocfree_log_count(mp, 3),
+                    xfs_calc_buf_res(xfs_allocfree_block_count(mp, 3),
                                      XFS_FSB_TO_B(mp, 1))));
 }
 
@@ -480,7 +480,7 @@ xfs_calc_link_reservation(
                     xfs_calc_buf_res(XFS_DIROP_LOG_COUNT(mp),
                                      XFS_FSB_TO_B(mp, 1))),
                    (xfs_calc_buf_res(3, mp->m_sb.sb_sectsize) +
-                    xfs_calc_buf_res(xfs_allocfree_log_count(mp, 1),
+                    xfs_calc_buf_res(xfs_allocfree_block_count(mp, 1),
                                      XFS_FSB_TO_B(mp, 1))));
 }
 
@@ -518,7 +518,7 @@ xfs_calc_remove_reservation(
                     xfs_calc_buf_res(XFS_DIROP_LOG_COUNT(mp),
                                      XFS_FSB_TO_B(mp, 1))),
                    (xfs_calc_buf_res(4, mp->m_sb.sb_sectsize) +
-                    xfs_calc_buf_res(xfs_allocfree_log_count(mp, 2),
+                    xfs_calc_buf_res(xfs_allocfree_block_count(mp, 2),
                                      XFS_FSB_TO_B(mp, 1))));
 }
 
@@ -663,7 +663,7 @@ xfs_calc_growdata_reservation(
        struct xfs_mount        *mp)
 {
        return xfs_calc_buf_res(3, mp->m_sb.sb_sectsize) +
-               xfs_calc_buf_res(xfs_allocfree_log_count(mp, 1),
+               xfs_calc_buf_res(xfs_allocfree_block_count(mp, 1),
                                 XFS_FSB_TO_B(mp, 1));
 }
 
@@ -685,7 +685,7 @@ xfs_calc_growrtalloc_reservation(
                xfs_calc_buf_res(XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK),
                                 XFS_FSB_TO_B(mp, 1)) +
                xfs_calc_inode_res(mp, 1) +
-               xfs_calc_buf_res(xfs_allocfree_log_count(mp, 1),
+               xfs_calc_buf_res(xfs_allocfree_block_count(mp, 1),
                                 XFS_FSB_TO_B(mp, 1));
 }
 
@@ -761,7 +761,7 @@ xfs_calc_addafork_reservation(
                xfs_calc_buf_res(1, mp->m_dir_geo->blksize) +
                xfs_calc_buf_res(XFS_DAENTER_BMAP1B(mp, XFS_DATA_FORK) + 1,
                                 XFS_FSB_TO_B(mp, 1)) +
-               xfs_calc_buf_res(xfs_allocfree_log_count(mp, 1),
+               xfs_calc_buf_res(xfs_allocfree_block_count(mp, 1),
                                 XFS_FSB_TO_B(mp, 1));
 }
 
@@ -784,7 +784,7 @@ xfs_calc_attrinval_reservation(
                    xfs_calc_buf_res(XFS_BM_MAXLEVELS(mp, XFS_ATTR_FORK),
                                     XFS_FSB_TO_B(mp, 1))),
                   (xfs_calc_buf_res(9, mp->m_sb.sb_sectsize) +
-                   xfs_calc_buf_res(xfs_allocfree_log_count(mp, 4),
+                   xfs_calc_buf_res(xfs_allocfree_block_count(mp, 4),
                                     XFS_FSB_TO_B(mp, 1))));
 }
 
@@ -851,7 +851,7 @@ xfs_calc_attrrm_reservation(
                                        XFS_BM_MAXLEVELS(mp, XFS_ATTR_FORK)) +
                     xfs_calc_buf_res(XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK), 0)),
                    (xfs_calc_buf_res(5, mp->m_sb.sb_sectsize) +
-                    xfs_calc_buf_res(xfs_allocfree_log_count(mp, 2),
+                    xfs_calc_buf_res(xfs_allocfree_block_count(mp, 2),
                                      XFS_FSB_TO_B(mp, 1))));
 }
 
index 22b99042127a03ba276824256deb24b193711e1f..0554b9d775d2697868d26e72d2deb138b5a2f034 100644 (file)
@@ -96,7 +96,7 @@ struct xfs_trans_resv {
 #define        XFS_WRITE_LOG_COUNT_REFLINK     8
 
 void xfs_trans_resv_calc(struct xfs_mount *mp, struct xfs_trans_resv *resp);
-uint xfs_allocfree_log_count(struct xfs_mount *mp, uint num_ops);
+uint xfs_allocfree_block_count(struct xfs_mount *mp, uint num_ops);
 
 unsigned int xfs_calc_itruncate_reservation_minlogsize(struct xfs_mount *mp);
 unsigned int xfs_calc_write_reservation_minlogsize(struct xfs_mount *mp);