diff options
author | David Sterba <dsterba@suse.com> | 2023-09-22 13:07:18 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2023-10-12 16:44:13 +0200 |
commit | d23d42e39b03f3fb5fd06e8c8a38447beae8e217 (patch) | |
tree | 25dda6f4755009ade0f0dd7a48f87b7f37ee6720 | |
parent | btrfs: relocation: use enum for stages (diff) | |
download | linux-d23d42e39b03f3fb5fd06e8c8a38447beae8e217.tar.xz linux-d23d42e39b03f3fb5fd06e8c8a38447beae8e217.zip |
btrfs: relocation: switch bitfields to bool in reloc_control
Use bool types for the indicators instead of bitfields. The structure
size slightly grows but the new types are placed within the padding.
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r-- | fs/btrfs/relocation.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index 3afe499f00b1..87ac8528032c 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -163,9 +163,9 @@ struct reloc_control { u64 extents_found; enum reloc_stage stage; - unsigned int create_reloc_tree:1; - unsigned int merge_reloc_tree:1; - unsigned int found_file_extent:1; + bool create_reloc_tree; + bool merge_reloc_tree; + bool found_file_extent; }; static void mark_block_processed(struct reloc_control *rc, @@ -1902,7 +1902,7 @@ again: } } - rc->merge_reloc_tree = 1; + rc->merge_reloc_tree = true; while (!list_empty(&rc->reloc_roots)) { reloc_root = list_entry(rc->reloc_roots.next, @@ -3659,7 +3659,7 @@ int prepare_to_relocate(struct reloc_control *rc) if (ret) return ret; - rc->create_reloc_tree = 1; + rc->create_reloc_tree = true; set_reloc_control(rc); trans = btrfs_join_transaction(rc->extent_root); @@ -3786,7 +3786,7 @@ restart: if (rc->stage == MOVE_DATA_EXTENTS && (flags & BTRFS_EXTENT_FLAG_DATA)) { - rc->found_file_extent = 1; + rc->found_file_extent = true; ret = relocate_data_extent(rc->data_inode, &key, &rc->cluster); if (ret < 0) { @@ -3823,7 +3823,7 @@ restart: err = ret; } - rc->create_reloc_tree = 0; + rc->create_reloc_tree = false; set_reloc_control(rc); btrfs_backref_release_cache(&rc->backref_cache); @@ -3841,7 +3841,7 @@ restart: merge_reloc_roots(rc); - rc->merge_reloc_tree = 0; + rc->merge_reloc_tree = false; unset_reloc_control(rc); btrfs_block_rsv_release(fs_info, rc->block_rsv, (u64)-1, NULL); @@ -4355,7 +4355,7 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info) goto out_unset; } - rc->merge_reloc_tree = 1; + rc->merge_reloc_tree = true; while (!list_empty(&reloc_roots)) { reloc_root = list_entry(reloc_roots.next, |