Skip to content

Commit d2f7cf4

Browse files
Kemeng Shitytso
authored andcommitted
ext4: make state in ext4_mb_mark_bb to be bool
As state could only be either 0 or 1, just make it bool. Signed-off-by: Kemeng Shi <[email protected]> Reviewed-by: "Ritesh Harjani (IBM)" <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
1 parent 61187fc commit d2f7cf4

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

fs/ext4/ext4.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2926,7 +2926,7 @@ extern int ext4_group_add_blocks(handle_t *handle, struct super_block *sb,
29262926
extern int ext4_trim_fs(struct super_block *, struct fstrim_range *);
29272927
extern void ext4_process_freed_data(struct super_block *sb, tid_t commit_tid);
29282928
extern void ext4_mb_mark_bb(struct super_block *sb, ext4_fsblk_t block,
2929-
int len, int state);
2929+
int len, bool state);
29302930
static inline bool ext4_mb_cr_expensive(enum criteria cr)
29312931
{
29322932
return cr >= CR_GOAL_LEN_SLOW;

fs/ext4/extents.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6080,13 +6080,13 @@ int ext4_ext_clear_bb(struct inode *inode)
60806080
for (j = 0; j < path->p_depth; j++) {
60816081

60826082
ext4_mb_mark_bb(inode->i_sb,
6083-
path[j].p_block, 1, 0);
6083+
path[j].p_block, 1, false);
60846084
ext4_fc_record_regions(inode->i_sb, inode->i_ino,
60856085
0, path[j].p_block, 1, 1);
60866086
}
60876087
ext4_free_ext_path(path);
60886088
}
6089-
ext4_mb_mark_bb(inode->i_sb, map.m_pblk, map.m_len, 0);
6089+
ext4_mb_mark_bb(inode->i_sb, map.m_pblk, map.m_len, false);
60906090
ext4_fc_record_regions(inode->i_sb, inode->i_ino,
60916091
map.m_lblk, map.m_pblk, map.m_len, 1);
60926092
}

fs/ext4/fast_commit.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1806,7 +1806,7 @@ static int ext4_fc_replay_add_range(struct super_block *sb,
18061806
* at the end of the FC replay using our array of
18071807
* modified inodes.
18081808
*/
1809-
ext4_mb_mark_bb(inode->i_sb, map.m_pblk, map.m_len, 0);
1809+
ext4_mb_mark_bb(inode->i_sb, map.m_pblk, map.m_len, false);
18101810
goto next;
18111811
}
18121812

@@ -1875,7 +1875,7 @@ ext4_fc_replay_del_range(struct super_block *sb,
18751875
if (ret > 0) {
18761876
remaining -= ret;
18771877
cur += ret;
1878-
ext4_mb_mark_bb(inode->i_sb, map.m_pblk, map.m_len, 0);
1878+
ext4_mb_mark_bb(inode->i_sb, map.m_pblk, map.m_len, false);
18791879
} else {
18801880
remaining -= map.m_len;
18811881
cur += map.m_len;
@@ -1934,12 +1934,12 @@ static void ext4_fc_set_bitmaps_and_counters(struct super_block *sb)
19341934
if (!IS_ERR(path)) {
19351935
for (j = 0; j < path->p_depth; j++)
19361936
ext4_mb_mark_bb(inode->i_sb,
1937-
path[j].p_block, 1, 1);
1937+
path[j].p_block, 1, true);
19381938
ext4_free_ext_path(path);
19391939
}
19401940
cur += ret;
19411941
ext4_mb_mark_bb(inode->i_sb, map.m_pblk,
1942-
map.m_len, 1);
1942+
map.m_len, true);
19431943
} else {
19441944
cur = cur + (map.m_len ? map.m_len : 1);
19451945
}

fs/ext4/mballoc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4067,7 +4067,7 @@ ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac,
40674067
* blocks in bitmaps and update counters.
40684068
*/
40694069
void ext4_mb_mark_bb(struct super_block *sb, ext4_fsblk_t block,
4070-
int len, int state)
4070+
int len, bool state)
40714071
{
40724072
struct buffer_head *bitmap_bh = NULL;
40734073
struct ext4_group_desc *gdp;
@@ -6095,7 +6095,7 @@ ext4_mb_new_blocks_simple(struct ext4_allocation_request *ar, int *errp)
60956095
}
60966096

60976097
block = ext4_group_first_block_no(sb, group) + EXT4_C2B(sbi, i);
6098-
ext4_mb_mark_bb(sb, block, 1, 1);
6098+
ext4_mb_mark_bb(sb, block, 1, true);
60996099
ar->len = 1;
61006100

61016101
return block;

0 commit comments

Comments
 (0)