From e23efd8e8767165a6103cf0a4fe273f6b9f182f2 Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Tue, 15 Nov 2022 11:16:16 -0500 Subject: 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 Signed-off-by: David Sterba --- fs/btrfs/accessors.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'fs/btrfs/accessors.h') 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); } -- cgit v1.2.3-73-gaa49b