summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/struct-funcs.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2020-04-29 02:15:56 +0200
committerDavid Sterba <dsterba@suse.com>2020-05-25 11:25:32 +0200
commitcc4c13d55cba8a0b81bc18243eabc57be1aa44d2 (patch)
tree5b472872c02152aa5d608b9811dd67da9925b230 /fs/btrfs/struct-funcs.c
parent4dae666a6286ce5d9f4890f8b88af646473686f0 (diff)
btrfs: drop eb parameter from set/get token helpers
Now that all set/get helpers use the eb from the token, we don't need to pass it to many btrfs_token_*/btrfs_set_token_* helpers, saving some stack space. Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/struct-funcs.c')
-rw-r--r--fs/btrfs/struct-funcs.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/fs/btrfs/struct-funcs.c b/fs/btrfs/struct-funcs.c
index 7928d310f698..cebd0b5e4f37 100644
--- a/fs/btrfs/struct-funcs.c
+++ b/fs/btrfs/struct-funcs.c
@@ -38,9 +38,8 @@ static inline void put_unaligned_le8(u8 val, void *p)
*/
#define DEFINE_BTRFS_SETGET_BITS(bits) \
-u##bits btrfs_get_token_##bits(const struct extent_buffer *eb, \
- const void *ptr, unsigned long off, \
- struct btrfs_map_token *token) \
+u##bits btrfs_get_token_##bits(struct btrfs_map_token *token, \
+ const void *ptr, unsigned long off) \
{ \
unsigned long part_offset = (unsigned long)ptr; \
unsigned long offset = part_offset + off; \
@@ -53,7 +52,6 @@ u##bits btrfs_get_token_##bits(const struct extent_buffer *eb, \
u##bits res; \
\
ASSERT(token); \
- ASSERT(token->eb == eb); \
\
if (token->kaddr && token->offset <= offset && \
(token->offset + PAGE_SIZE >= offset + size)) { \
@@ -101,10 +99,9 @@ u##bits btrfs_get_##bits(const struct extent_buffer *eb, \
res = get_unaligned_le##bits(p + off); \
return res; \
} \
-void btrfs_set_token_##bits(struct extent_buffer *eb, \
+void btrfs_set_token_##bits(struct btrfs_map_token *token, \
const void *ptr, unsigned long off, \
- u##bits val, \
- struct btrfs_map_token *token) \
+ u##bits val) \
{ \
unsigned long part_offset = (unsigned long)ptr; \
unsigned long offset = part_offset + off; \
@@ -116,7 +113,6 @@ void btrfs_set_token_##bits(struct extent_buffer *eb, \
int size = sizeof(u##bits); \
\
ASSERT(token); \
- ASSERT(token->eb == eb); \
\
if (token->kaddr && token->offset <= offset && \
(token->offset + PAGE_SIZE >= offset + size)) { \