btrfs: open code trivial helper btrfs_header_chunk_tree_uuid
authorDavid Sterba <dsterba@suse.com>
Wed, 20 Mar 2019 12:17:13 +0000 (13:17 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 23 Mar 2020 16:01:44 +0000 (17:01 +0100)
The helper btrfs_header_chunk_tree_uuid follows naming convention of
other struct accessors but does something compeletly different. As the
offsetof calculation is clear in the context of extent buffer operations
we can remove it.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/disk-io.c

index f66c4ea7491d58dceb8c7bba3c3eefc64398fee1..1cde3f1d8f205c718ec50d15e6bb466a53ab306c 100644 (file)
@@ -1973,11 +1973,6 @@ static inline void btrfs_set_header_backref_rev(struct extent_buffer *eb,
        btrfs_set_header_flags(eb, flags);
 }
 
-static inline unsigned long btrfs_header_chunk_tree_uuid(const struct extent_buffer *eb)
-{
-       return offsetof(struct btrfs_header, chunk_tree_uuid);
-}
-
 static inline int btrfs_is_leaf(const struct extent_buffer *eb)
 {
        return btrfs_header_level(eb) == 0;
index 2e482657a1b4a6aa5d2ebcda6f39498baa28f734..abd7a613c8e6f5b36ded9c856f92b69b7891ff75 100644 (file)
@@ -3106,7 +3106,8 @@ int __cold open_ctree(struct super_block *sb, struct btrfs_fs_devices *fs_device
        chunk_root->commit_root = btrfs_root_node(chunk_root);
 
        read_extent_buffer(chunk_root->node, fs_info->chunk_tree_uuid,
-          btrfs_header_chunk_tree_uuid(chunk_root->node), BTRFS_UUID_SIZE);
+                          offsetof(struct btrfs_header, chunk_tree_uuid),
+                          BTRFS_UUID_SIZE);
 
        ret = btrfs_read_chunk_tree(fs_info);
        if (ret) {