diff options
author | Josef Bacik <josef@toxicpanda.com> | 2022-11-15 11:16:18 -0500 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2022-12-05 18:00:58 +0100 |
commit | 8009adf306452e9b43db36f2d02fedfe5eca1b5e (patch) | |
tree | 2b85463ff6eba105048a0df3e0267e7789df753e /fs/btrfs | |
parent | 637e3b48c22e52daa645b49b73630af3f09328ae (diff) | |
download | linux-stable-8009adf306452e9b43db36f2d02fedfe5eca1b5e.tar.gz linux-stable-8009adf306452e9b43db36f2d02fedfe5eca1b5e.tar.bz2 linux-stable-8009adf306452e9b43db36f2d02fedfe5eca1b5e.zip |
btrfs: remove BTRFS_LEAF_DATA_OFFSET
This is simply the same thing as btrfs_item_nr_offset(leaf, 0), so
remove this helper and replace it's usage with the above statement.
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/accessors.h | 6 | ||||
-rw-r--r-- | fs/btrfs/ctree.c | 8 | ||||
-rw-r--r-- | fs/btrfs/extent_io.c | 2 |
3 files changed, 7 insertions, 9 deletions
diff --git a/fs/btrfs/accessors.h b/fs/btrfs/accessors.h index 88eea44fdd7f..e6228ff73c81 100644 --- a/fs/btrfs/accessors.h +++ b/fs/btrfs/accessors.h @@ -9,8 +9,6 @@ struct btrfs_map_token { unsigned long offset; }; -#define BTRFS_LEAF_DATA_OFFSET offsetof(struct btrfs_leaf, items) - void btrfs_init_map_token(struct btrfs_map_token *token, struct extent_buffer *eb); /* @@ -1028,9 +1026,9 @@ BTRFS_SETGET_STACK_FUNCS(stack_verity_descriptor_size, /* Cast into the data area of the leaf. */ #define btrfs_item_ptr(leaf, slot, type) \ - ((type *)(BTRFS_LEAF_DATA_OFFSET + btrfs_item_offset(leaf, slot))) + ((type *)(btrfs_item_nr_offset(leaf, 0) + btrfs_item_offset(leaf, slot))) #define btrfs_item_ptr_offset(leaf, slot) \ - ((unsigned long)(BTRFS_LEAF_DATA_OFFSET + btrfs_item_offset(leaf, slot))) + ((unsigned long)(btrfs_item_nr_offset(leaf, 0) + btrfs_item_offset(leaf, slot))) #endif diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index b5d203045dc7..76b99bcc849d 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c @@ -83,8 +83,8 @@ static inline void memmove_leaf_data(const struct extent_buffer *leaf, unsigned long src_offset, unsigned long len) { - memmove_extent_buffer(leaf, BTRFS_LEAF_DATA_OFFSET + dst_offset, - BTRFS_LEAF_DATA_OFFSET + src_offset, len); + memmove_extent_buffer(leaf, btrfs_item_nr_offset(leaf, 0) + dst_offset, + btrfs_item_nr_offset(leaf, 0) + src_offset, len); } /* @@ -106,8 +106,8 @@ static inline void copy_leaf_data(const struct extent_buffer *dst, unsigned long dst_offset, unsigned long src_offset, unsigned long len) { - copy_extent_buffer(dst, src, BTRFS_LEAF_DATA_OFFSET + dst_offset, - BTRFS_LEAF_DATA_OFFSET + src_offset, len); + copy_extent_buffer(dst, src, btrfs_item_nr_offset(dst, 0) + dst_offset, + btrfs_item_nr_offset(src, 0) + src_offset, len); } /* diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index f1d5a851968f..83dd3aa59663 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -2537,7 +2537,7 @@ static void prepare_eb_write(struct extent_buffer *eb) * header 0 1 2 .. N ... data_N .. data_2 data_1 data_0 */ start = btrfs_item_nr_offset(eb, nritems); - end = BTRFS_LEAF_DATA_OFFSET; + end = btrfs_item_nr_offset(eb, 0); if (nritems == 0) end += BTRFS_LEAF_DATA_SIZE(eb->fs_info); else |