summaryrefslogtreecommitdiff
path: root/fs/btrfs/accessors.h
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2022-11-15 11:16:18 -0500
committerDavid Sterba <dsterba@suse.com>2022-12-05 18:00:58 +0100
commit8009adf306452e9b43db36f2d02fedfe5eca1b5e (patch)
tree2b85463ff6eba105048a0df3e0267e7789df753e /fs/btrfs/accessors.h
parent637e3b48c22e52daa645b49b73630af3f09328ae (diff)
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/accessors.h')
-rw-r--r--fs/btrfs/accessors.h6
1 files changed, 2 insertions, 4 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