aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ref-verify.c
diff options
context:
space:
mode:
authorMisono Tomohiro <misono.tomohiro@jp.fujitsu.com>2018-08-06 01:25:24 -0400
committerDavid Sterba <dsterba@suse.com>2018-10-15 11:23:25 -0400
commit4fd786e6c3d67b1348e0ad4f450efe9fc9d7a306 (patch)
treee6d69dcd0ca8a988c3104cfdec3e1e2e3d0bc6a5 /fs/btrfs/ref-verify.c
parent5a2cb25ab9da5046f10e773c9ecfdb3339f3dd7c (diff)
btrfs: Remove 'objectid' member from struct btrfs_root
There are two members in struct btrfs_root which indicate root's objectid: objectid and root_key.objectid. They are both set to the same value in __setup_root(): static void __setup_root(struct btrfs_root *root, struct btrfs_fs_info *fs_info, u64 objectid) { ... root->objectid = objectid; ... root->root_key.objectid = objecitd; ... } and not changed to other value after initialization. grep in btrfs directory shows both are used in many places: $ grep -rI "root->root_key.objectid" | wc -l 133 $ grep -rI "root->objectid" | wc -l 55 (4.17, inc. some noise) It is confusing to have two similar variable names and it seems that there is no rule about which should be used in a certain case. Since ->root_key itself is needed for tree reloc tree, let's remove 'objecitd' member and unify code to use ->root_key.objectid in all places. Signed-off-by: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com> Reviewed-by: Qu Wenruo <wqu@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/ref-verify.c')
-rw-r--r--fs/btrfs/ref-verify.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/btrfs/ref-verify.c b/fs/btrfs/ref-verify.c
index e5b9e596bb92..d69fbfb30aa9 100644
--- a/fs/btrfs/ref-verify.c
+++ b/fs/btrfs/ref-verify.c
@@ -732,7 +732,7 @@ int btrfs_ref_tree_mod(struct btrfs_root *root, u64 bytenr, u64 num_bytes,
732 732
733 INIT_LIST_HEAD(&ra->list); 733 INIT_LIST_HEAD(&ra->list);
734 ra->action = action; 734 ra->action = action;
735 ra->root = root->objectid; 735 ra->root = root->root_key.objectid;
736 736
737 /* 737 /*
738 * This is an allocation, preallocate the block_entry in case we haven't 738 * This is an allocation, preallocate the block_entry in case we haven't
@@ -787,8 +787,8 @@ int btrfs_ref_tree_mod(struct btrfs_root *root, u64 bytenr, u64 num_bytes,
787 * one we want to lookup below when we modify the 787 * one we want to lookup below when we modify the
788 * re->num_refs. 788 * re->num_refs.
789 */ 789 */
790 ref_root = root->objectid; 790 ref_root = root->root_key.objectid;
791 re->root_objectid = root->objectid; 791 re->root_objectid = root->root_key.objectid;
792 re->num_refs = 0; 792 re->num_refs = 0;
793 } 793 }
794 794
@@ -862,7 +862,7 @@ int btrfs_ref_tree_mod(struct btrfs_root *root, u64 bytenr, u64 num_bytes,
862 * didn't thik of some other corner case. 862 * didn't thik of some other corner case.
863 */ 863 */
864 btrfs_err(fs_info, "failed to find root %llu for %llu", 864 btrfs_err(fs_info, "failed to find root %llu for %llu",
865 root->objectid, be->bytenr); 865 root->root_key.objectid, be->bytenr);
866 dump_block_entry(fs_info, be); 866 dump_block_entry(fs_info, be);
867 dump_ref_action(fs_info, ra); 867 dump_ref_action(fs_info, ra);
868 kfree(ra); 868 kfree(ra);