aboutsummaryrefslogtreecommitdiff
path: root/fs/btrfs/accessors.c
diff options
context:
space:
mode:
authorGravatar Josef Bacik <josef@toxicpanda.com> 2022-10-19 10:50:59 -0400
committerGravatar David Sterba <dsterba@suse.com> 2022-12-05 18:00:42 +0100
commitad1ac5012c2beccc9de4d3e2cc1382fd250e5540 (patch)
tree0e733f175467c9c8953412d818817f67bf36aac8 /fs/btrfs/accessors.c
parentbtrfs: rename struct-funcs.c to accessors.c (diff)
downloadlinux-ad1ac5012c2beccc9de4d3e2cc1382fd250e5540.tar.gz
linux-ad1ac5012c2beccc9de4d3e2cc1382fd250e5540.tar.bz2
linux-ad1ac5012c2beccc9de4d3e2cc1382fd250e5540.zip
btrfs: move btrfs_map_token to accessors
This is specific to the item-accessor code, move it out of ctree.h into accessor.h/.c and then update the users to include the new header file. This un-inlines btrfs_init_map_token, however this is only called once per function so it's not critical to be inlined. This also saves 904 bytes of code on a release build. Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/accessors.c')
-rw-r--r--fs/btrfs/accessors.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/btrfs/accessors.c b/fs/btrfs/accessors.c
index 118bfd1c0e3e..7a7b7d263102 100644
--- a/fs/btrfs/accessors.c
+++ b/fs/btrfs/accessors.c
@@ -6,6 +6,7 @@
#include <asm/unaligned.h>
#include "messages.h"
#include "ctree.h"
+#include "accessors.h"
static bool check_setget_bounds(const struct extent_buffer *eb,
const void *ptr, unsigned off, int size)
@@ -23,6 +24,13 @@ static bool check_setget_bounds(const struct extent_buffer *eb,
return true;
}
+void btrfs_init_map_token(struct btrfs_map_token *token, struct extent_buffer *eb)
+{
+ token->eb = eb;
+ token->kaddr = page_address(eb->pages[0]);
+ token->offset = 0;
+}
+
/*
* Macro templates that define helpers to read/write extent buffer data of a
* given size, that are also used via ctree.h for access to item members by