Skip to content

Commit 6ed7e50

Browse files
author
Darrick J. Wong
committed
xfs: rename xfs_*alloc*_log_count to _block_count
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 <[email protected]> Reviewed-by: Dave Chinner <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]>
1 parent df2fd88 commit 6ed7e50

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

fs/xfs/libxfs/xfs_refcount.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ xfs_refcount_still_have_space(
890890
* Worst case estimate: full splits of the free space and rmap btrees
891891
* to handle each of the shape changes to the refcount btree.
892892
*/
893-
overhead = xfs_allocfree_log_count(cur->bc_mp,
893+
overhead = xfs_allocfree_block_count(cur->bc_mp,
894894
cur->bc_ag.refc.shape_changes);
895895
overhead += cur->bc_mp->m_refc_maxlevels;
896896
overhead *= cur->bc_mp->m_sb.sb_blocksize;

fs/xfs/libxfs/xfs_trans_resv.c

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ xfs_calc_buf_res(
6363
* Keep in mind that max depth is calculated separately for each type of tree.
6464
*/
6565
uint
66-
xfs_allocfree_log_count(
66+
xfs_allocfree_block_count(
6767
struct xfs_mount *mp,
6868
uint num_ops)
6969
{
@@ -146,7 +146,7 @@ xfs_calc_inobt_res(
146146
{
147147
return xfs_calc_buf_res(M_IGEO(mp)->inobt_maxlevels,
148148
XFS_FSB_TO_B(mp, 1)) +
149-
xfs_calc_buf_res(xfs_allocfree_log_count(mp, 1),
149+
xfs_calc_buf_res(xfs_allocfree_block_count(mp, 1),
150150
XFS_FSB_TO_B(mp, 1));
151151
}
152152

@@ -193,7 +193,7 @@ xfs_calc_inode_chunk_res(
193193
{
194194
uint res, size = 0;
195195

196-
res = xfs_calc_buf_res(xfs_allocfree_log_count(mp, 1),
196+
res = xfs_calc_buf_res(xfs_allocfree_block_count(mp, 1),
197197
XFS_FSB_TO_B(mp, 1));
198198
if (alloc) {
199199
/* icreate tx uses ordered buffers */
@@ -213,7 +213,7 @@ xfs_calc_inode_chunk_res(
213213
* extents, as well as the realtime summary block.
214214
*/
215215
static unsigned int
216-
xfs_rtalloc_log_count(
216+
xfs_rtalloc_block_count(
217217
struct xfs_mount *mp,
218218
unsigned int num_ops)
219219
{
@@ -300,21 +300,21 @@ xfs_calc_write_reservation(
300300
t1 = xfs_calc_inode_res(mp, 1) +
301301
xfs_calc_buf_res(XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK), blksz) +
302302
xfs_calc_buf_res(3, mp->m_sb.sb_sectsize) +
303-
xfs_calc_buf_res(xfs_allocfree_log_count(mp, 2), blksz);
303+
xfs_calc_buf_res(xfs_allocfree_block_count(mp, 2), blksz);
304304

305305
if (xfs_has_realtime(mp)) {
306306
t2 = xfs_calc_inode_res(mp, 1) +
307307
xfs_calc_buf_res(XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK),
308308
blksz) +
309309
xfs_calc_buf_res(3, mp->m_sb.sb_sectsize) +
310-
xfs_calc_buf_res(xfs_rtalloc_log_count(mp, 1), blksz) +
311-
xfs_calc_buf_res(xfs_allocfree_log_count(mp, 1), blksz);
310+
xfs_calc_buf_res(xfs_rtalloc_block_count(mp, 1), blksz) +
311+
xfs_calc_buf_res(xfs_allocfree_block_count(mp, 1), blksz);
312312
} else {
313313
t2 = 0;
314314
}
315315

316316
t3 = xfs_calc_buf_res(5, mp->m_sb.sb_sectsize) +
317-
xfs_calc_buf_res(xfs_allocfree_log_count(mp, 2), blksz);
317+
xfs_calc_buf_res(xfs_allocfree_block_count(mp, 2), blksz);
318318

319319
/*
320320
* In the early days of reflink, we included enough reservation to log
@@ -381,12 +381,12 @@ xfs_calc_itruncate_reservation(
381381
xfs_calc_buf_res(XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK) + 1, blksz);
382382

383383
t2 = xfs_calc_buf_res(9, mp->m_sb.sb_sectsize) +
384-
xfs_calc_buf_res(xfs_allocfree_log_count(mp, 4), blksz);
384+
xfs_calc_buf_res(xfs_allocfree_block_count(mp, 4), blksz);
385385

386386
if (xfs_has_realtime(mp)) {
387387
t3 = xfs_calc_buf_res(5, mp->m_sb.sb_sectsize) +
388-
xfs_calc_buf_res(xfs_rtalloc_log_count(mp, 2), blksz) +
389-
xfs_calc_buf_res(xfs_allocfree_log_count(mp, 2), blksz);
388+
xfs_calc_buf_res(xfs_rtalloc_block_count(mp, 2), blksz) +
389+
xfs_calc_buf_res(xfs_allocfree_block_count(mp, 2), blksz);
390390
} else {
391391
t3 = 0;
392392
}
@@ -441,7 +441,7 @@ xfs_calc_rename_reservation(
441441
xfs_calc_buf_res(2 * XFS_DIROP_LOG_COUNT(mp),
442442
XFS_FSB_TO_B(mp, 1))),
443443
(xfs_calc_buf_res(7, mp->m_sb.sb_sectsize) +
444-
xfs_calc_buf_res(xfs_allocfree_log_count(mp, 3),
444+
xfs_calc_buf_res(xfs_allocfree_block_count(mp, 3),
445445
XFS_FSB_TO_B(mp, 1))));
446446
}
447447

@@ -481,7 +481,7 @@ xfs_calc_link_reservation(
481481
xfs_calc_buf_res(XFS_DIROP_LOG_COUNT(mp),
482482
XFS_FSB_TO_B(mp, 1))),
483483
(xfs_calc_buf_res(3, mp->m_sb.sb_sectsize) +
484-
xfs_calc_buf_res(xfs_allocfree_log_count(mp, 1),
484+
xfs_calc_buf_res(xfs_allocfree_block_count(mp, 1),
485485
XFS_FSB_TO_B(mp, 1))));
486486
}
487487

@@ -519,7 +519,7 @@ xfs_calc_remove_reservation(
519519
xfs_calc_buf_res(XFS_DIROP_LOG_COUNT(mp),
520520
XFS_FSB_TO_B(mp, 1))),
521521
(xfs_calc_buf_res(4, mp->m_sb.sb_sectsize) +
522-
xfs_calc_buf_res(xfs_allocfree_log_count(mp, 2),
522+
xfs_calc_buf_res(xfs_allocfree_block_count(mp, 2),
523523
XFS_FSB_TO_B(mp, 1))));
524524
}
525525

@@ -664,7 +664,7 @@ xfs_calc_growdata_reservation(
664664
struct xfs_mount *mp)
665665
{
666666
return xfs_calc_buf_res(3, mp->m_sb.sb_sectsize) +
667-
xfs_calc_buf_res(xfs_allocfree_log_count(mp, 1),
667+
xfs_calc_buf_res(xfs_allocfree_block_count(mp, 1),
668668
XFS_FSB_TO_B(mp, 1));
669669
}
670670

@@ -686,7 +686,7 @@ xfs_calc_growrtalloc_reservation(
686686
xfs_calc_buf_res(XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK),
687687
XFS_FSB_TO_B(mp, 1)) +
688688
xfs_calc_inode_res(mp, 1) +
689-
xfs_calc_buf_res(xfs_allocfree_log_count(mp, 1),
689+
xfs_calc_buf_res(xfs_allocfree_block_count(mp, 1),
690690
XFS_FSB_TO_B(mp, 1));
691691
}
692692

@@ -762,7 +762,7 @@ xfs_calc_addafork_reservation(
762762
xfs_calc_buf_res(1, mp->m_dir_geo->blksize) +
763763
xfs_calc_buf_res(XFS_DAENTER_BMAP1B(mp, XFS_DATA_FORK) + 1,
764764
XFS_FSB_TO_B(mp, 1)) +
765-
xfs_calc_buf_res(xfs_allocfree_log_count(mp, 1),
765+
xfs_calc_buf_res(xfs_allocfree_block_count(mp, 1),
766766
XFS_FSB_TO_B(mp, 1));
767767
}
768768

@@ -785,7 +785,7 @@ xfs_calc_attrinval_reservation(
785785
xfs_calc_buf_res(XFS_BM_MAXLEVELS(mp, XFS_ATTR_FORK),
786786
XFS_FSB_TO_B(mp, 1))),
787787
(xfs_calc_buf_res(9, mp->m_sb.sb_sectsize) +
788-
xfs_calc_buf_res(xfs_allocfree_log_count(mp, 4),
788+
xfs_calc_buf_res(xfs_allocfree_block_count(mp, 4),
789789
XFS_FSB_TO_B(mp, 1))));
790790
}
791791

@@ -852,7 +852,7 @@ xfs_calc_attrrm_reservation(
852852
XFS_BM_MAXLEVELS(mp, XFS_ATTR_FORK)) +
853853
xfs_calc_buf_res(XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK), 0)),
854854
(xfs_calc_buf_res(5, mp->m_sb.sb_sectsize) +
855-
xfs_calc_buf_res(xfs_allocfree_log_count(mp, 2),
855+
xfs_calc_buf_res(xfs_allocfree_block_count(mp, 2),
856856
XFS_FSB_TO_B(mp, 1))));
857857
}
858858

fs/xfs/libxfs/xfs_trans_resv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ struct xfs_trans_resv {
9696
#define XFS_WRITE_LOG_COUNT_REFLINK 8
9797

9898
void xfs_trans_resv_calc(struct xfs_mount *mp, struct xfs_trans_resv *resp);
99-
uint xfs_allocfree_log_count(struct xfs_mount *mp, uint num_ops);
99+
uint xfs_allocfree_block_count(struct xfs_mount *mp, uint num_ops);
100100

101101
unsigned int xfs_calc_itruncate_reservation_minlogsize(struct xfs_mount *mp);
102102
unsigned int xfs_calc_write_reservation_minlogsize(struct xfs_mount *mp);

0 commit comments

Comments
 (0)