diff options
author | Josef Bacik <josef@toxicpanda.com> | 2022-11-15 11:16:16 -0500 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2022-12-05 18:00:58 +0100 |
commit | e23efd8e8767165a6103cf0a4fe273f6b9f182f2 (patch) | |
tree | f1ed39ed08db71eca8a7203a7f9671da08b7a726 /fs/btrfs/accessors.h | |
parent | 42c9419a4c01910e9c46b0c2bb9090f76295bf01 (diff) |
btrfs: add eb to btrfs_node_key_ptr_offset
This is a change needed for extent tree v2, as we will be growing the
header size. This exists in btrfs-progs currently, and not having it
makes syncing accessors.[ch] more problematic. So make this change to
set us up for extent tree v2 and match what btrfs-progs does to make
syncing easier.
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.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/accessors.h b/fs/btrfs/accessors.h index 2b4fb696142b..88eea44fdd7f 100644 --- a/fs/btrfs/accessors.h +++ b/fs/btrfs/accessors.h @@ -392,7 +392,7 @@ static inline void btrfs_set_node_ptr_generation(const struct extent_buffer *eb, btrfs_set_key_generation(eb, (struct btrfs_key_ptr *)ptr, val); } -static inline unsigned long btrfs_node_key_ptr_offset(int nr) +static inline unsigned long btrfs_node_key_ptr_offset(const struct extent_buffer *eb, int nr) { return offsetof(struct btrfs_node, ptrs) + sizeof(struct btrfs_key_ptr) * nr; @@ -406,7 +406,7 @@ static inline void btrfs_set_node_key(const struct extent_buffer *eb, { unsigned long ptr; - ptr = btrfs_node_key_ptr_offset(nr); + ptr = btrfs_node_key_ptr_offset(eb, nr); write_eb_member(eb, (struct btrfs_key_ptr *)ptr, struct btrfs_key_ptr, key, disk_key); } |