Skip to content

Commit 65c3995

Browse files
Zhihao Chengtytso
authored andcommitted
ext4: rename 'page' references to 'folio' in multi-block allocator
The ext4 multi-block allocator now fully supports folio objects. Update all variable names, function names, and comments to replace legacy 'page' terminology with 'folio', improving clarity and consistency. No functional changes. Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com> Signed-off-by: Baokun Li <libaokun1@huawei.com> Reviewed-by: Zhang Yi <yi.zhang@huawei.com> Reviewed-by: Jan Kara <jack@suse.cz> Reviewed-by: Ojaswin Mujoo <ojaswin@linux.ibm.com> Message-ID: <20251121090654.631996-16-libaokun@huaweicloud.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
1 parent 31daa82 commit 65c3995

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

fs/ext4/mballoc.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,14 @@
9898
* block bitmap and buddy information. The information are stored in the
9999
* inode as:
100100
*
101-
* { page }
101+
* { folio }
102102
* [ group 0 bitmap][ group 0 buddy] [group 1][ group 1]...
103103
*
104104
*
105105
* one block each for bitmap and buddy information. So for each group we
106-
* take up 2 blocks. A page can contain blocks_per_page (PAGE_SIZE /
107-
* blocksize) blocks. So it can have information regarding groups_per_page
108-
* which is blocks_per_page/2
106+
* take up 2 blocks. A folio can contain blocks_per_folio (folio_size /
107+
* blocksize) blocks. So it can have information regarding groups_per_folio
108+
* which is blocks_per_folio/2
109109
*
110110
* The buddy cache inode is not stored on disk. The inode is thrown
111111
* away when the filesystem is unmounted.
@@ -1573,7 +1573,7 @@ static int ext4_mb_get_buddy_folio_lock(struct super_block *sb,
15731573
return 0;
15741574
}
15751575

1576-
static void ext4_mb_put_buddy_page_lock(struct ext4_buddy *e4b)
1576+
static void ext4_mb_put_buddy_folio_lock(struct ext4_buddy *e4b)
15771577
{
15781578
if (e4b->bd_bitmap_folio) {
15791579
folio_unlock(e4b->bd_bitmap_folio);
@@ -1587,7 +1587,7 @@ static void ext4_mb_put_buddy_page_lock(struct ext4_buddy *e4b)
15871587

15881588
/*
15891589
* Locking note: This routine calls ext4_mb_init_cache(), which takes the
1590-
* block group lock of all groups for this page; do not hold the BG lock when
1590+
* block group lock of all groups for this folio; do not hold the BG lock when
15911591
* calling this routine!
15921592
*/
15931593
static noinline_for_stack
@@ -1635,7 +1635,7 @@ int ext4_mb_init_group(struct super_block *sb, ext4_group_t group, gfp_t gfp)
16351635
if (e4b.bd_buddy_folio == NULL) {
16361636
/*
16371637
* If both the bitmap and buddy are in
1638-
* the same page we don't need to force
1638+
* the same folio we don't need to force
16391639
* init the buddy
16401640
*/
16411641
ret = 0;
@@ -1651,7 +1651,7 @@ int ext4_mb_init_group(struct super_block *sb, ext4_group_t group, gfp_t gfp)
16511651
goto err;
16521652
}
16531653
err:
1654-
ext4_mb_put_buddy_page_lock(&e4b);
1654+
ext4_mb_put_buddy_folio_lock(&e4b);
16551655
return ret;
16561656
}
16571657

@@ -2244,7 +2244,7 @@ static void ext4_mb_use_best_found(struct ext4_allocation_context *ac,
22442244
ac->ac_buddy = ret >> 16;
22452245

22462246
/*
2247-
* take the page reference. We want the page to be pinned
2247+
* take the folio reference. We want the folio to be pinned
22482248
* so that we don't get a ext4_mb_init_cache_call for this
22492249
* group until we update the bitmap. That would mean we
22502250
* double allocate blocks. The reference is dropped
@@ -2950,7 +2950,7 @@ static int ext4_mb_scan_group(struct ext4_allocation_context *ac,
29502950
if (cr < CR_ANY_FREE && spin_is_locked(ext4_group_lock_ptr(sb, group)))
29512951
return 0;
29522952

2953-
/* This now checks without needing the buddy page */
2953+
/* This now checks without needing the buddy folio */
29542954
ret = ext4_mb_good_group_nolock(ac, group, cr);
29552955
if (ret <= 0) {
29562956
if (!ac->ac_first_err)
@@ -4742,7 +4742,7 @@ static void ext4_discard_allocated_blocks(struct ext4_allocation_context *ac)
47424742
"ext4: mb_load_buddy failed (%d)", err))
47434743
/*
47444744
* This should never happen since we pin the
4745-
* pages in the ext4_allocation_context so
4745+
* folios in the ext4_allocation_context so
47464746
* ext4_mb_load_buddy() should never fail.
47474747
*/
47484748
return;

0 commit comments

Comments
 (0)