btrfs: rename btrfs_leaf_data to BTRFS_LEAF_DATA_OFFSET
Commit 5f39d397df
("Btrfs: Create extent_buffer interface
for large blocksizes") refactored btrfs_leaf_data function to take
extent_buffer rather than struct btrfs_leaf. However, as it turns out the
parameter being passed is never used. Furthermore this function no longer
returns the leaf data but rather the offset to it. So rename the function
to BTRFS_LEAF_DATA_OFFSET to make it consistent with other BTRFS_LEAF_*
helpers and turn it into a macro.
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
[ removed () from the macro ]
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:

committed by
David Sterba

parent
e1ddce71d6
commit
3d9ec8c49a
@@ -1293,6 +1293,8 @@ static inline u32 BTRFS_LEAF_DATA_SIZE(const struct btrfs_fs_info *info)
|
||||
return __BTRFS_LEAF_DATA_SIZE(info->nodesize);
|
||||
}
|
||||
|
||||
#define BTRFS_LEAF_DATA_OFFSET offsetof(struct btrfs_leaf, items)
|
||||
|
||||
static inline u32 BTRFS_MAX_ITEM_SIZE(const struct btrfs_fs_info *info)
|
||||
{
|
||||
return BTRFS_LEAF_DATA_SIZE(info) - sizeof(struct btrfs_item);
|
||||
@@ -2325,10 +2327,6 @@ static inline int btrfs_super_csum_size(struct btrfs_super_block *s)
|
||||
return btrfs_csum_sizes[t];
|
||||
}
|
||||
|
||||
static inline unsigned long btrfs_leaf_data(struct extent_buffer *l)
|
||||
{
|
||||
return offsetof(struct btrfs_leaf, items);
|
||||
}
|
||||
|
||||
/*
|
||||
* The leaf data grows from end-to-front in the node.
|
||||
@@ -2539,11 +2537,11 @@ BTRFS_SETGET_STACK_FUNCS(stack_dev_replace_cursor_right,
|
||||
|
||||
/* helper function to cast into the data area of the leaf. */
|
||||
#define btrfs_item_ptr(leaf, slot, type) \
|
||||
((type *)(btrfs_leaf_data(leaf) + \
|
||||
((type *)(BTRFS_LEAF_DATA_OFFSET + \
|
||||
btrfs_item_offset_nr(leaf, slot)))
|
||||
|
||||
#define btrfs_item_ptr_offset(leaf, slot) \
|
||||
((unsigned long)(btrfs_leaf_data(leaf) + \
|
||||
((unsigned long)(BTRFS_LEAF_DATA_OFFSET + \
|
||||
btrfs_item_offset_nr(leaf, slot)))
|
||||
|
||||
static inline bool btrfs_mixed_space_info(struct btrfs_space_info *space_info)
|
||||
|
Reference in New Issue
Block a user