btrfs: move accessor helpers into accessors.h

This is a large patch, but because they're all macros it's impossible to
split up.  Simply copy all of the item accessors in ctree.h and paste
them in accessors.h, and then update any files to include the header so
everything compiles.

Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ reformat comments, style fixups ]
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Josef Bacik 2022-10-19 10:51:00 -04:00 committed by David Sterba
parent ad1ac5012c
commit 07e81dc944
46 changed files with 1112 additions and 1091 deletions

File diff suppressed because it is too large Load Diff

View File

@ -16,6 +16,7 @@
#include "misc.h"
#include "tree-mod-log.h"
#include "fs.h"
#include "accessors.h"
/* Just arbitrary numbers so we can be sure one of these happened. */
#define BACKREF_FOUND_SHARED 6

View File

@ -18,6 +18,7 @@
#include "raid56.h"
#include "zoned.h"
#include "fs.h"
#include "accessors.h"
#ifdef CONFIG_BTRFS_DEBUG
int btrfs_should_fragment_free_space(struct btrfs_block_group *block_group)

View File

@ -8,6 +8,7 @@
#include "block-group.h"
#include "disk-io.h"
#include "fs.h"
#include "accessors.h"
/*
* HOW DO BLOCK RESERVES WORK

View File

@ -93,6 +93,7 @@
#include "check-integrity.h"
#include "rcu-string.h"
#include "compression.h"
#include "accessors.h"
#define BTRFSIC_BLOCK_HASHTABLE_SIZE 0x10000
#define BTRFSIC_BLOCK_LINK_HASHTABLE_SIZE 0x10000

File diff suppressed because it is too large Load Diff

View File

@ -17,6 +17,7 @@
#include "locking.h"
#include "inode-item.h"
#include "space-info.h"
#include "accessors.h"
#define BTRFS_DELAYED_WRITEBACK 512
#define BTRFS_DELAYED_BACKGROUND 128

View File

@ -24,6 +24,7 @@
#include "zoned.h"
#include "block-group.h"
#include "fs.h"
#include "accessors.h"
/*
* Device replace overview

View File

@ -7,6 +7,7 @@
#include "ctree.h"
#include "disk-io.h"
#include "transaction.h"
#include "accessors.h"
/*
* insert a name into a directory, doing overflow properly if there is a hash

View File

@ -44,6 +44,7 @@
#include "zoned.h"
#include "subpage.h"
#include "fs.h"
#include "accessors.h"
#define BTRFS_SUPER_FLAG_SUPP (BTRFS_HEADER_FLAG_WRITTEN |\
BTRFS_HEADER_FLAG_RELOC |\

View File

@ -7,6 +7,7 @@
#include "btrfs_inode.h"
#include "print-tree.h"
#include "export.h"
#include "accessors.h"
#define BTRFS_FID_SIZE_NON_CONNECTABLE (offsetof(struct btrfs_fid, \
parent_objectid) / 4)

View File

@ -37,6 +37,7 @@
#include "zoned.h"
#include "dev-replace.h"
#include "fs.h"
#include "accessors.h"
#undef SCRAMBLE_DELAYED_REFS

View File

@ -31,6 +31,7 @@
#include "block-group.h"
#include "compression.h"
#include "fs.h"
#include "accessors.h"
static struct kmem_cache *extent_buffer_cache;

View File

@ -18,6 +18,7 @@
#include "print-tree.h"
#include "compression.h"
#include "fs.h"
#include "accessors.h"
#define __MAX_CSUM_ITEMS(r, size) ((unsigned long)(((BTRFS_LEAF_DATA_SIZE(r) - \
sizeof(struct btrfs_item) * 2) / \

View File

@ -31,6 +31,7 @@
#include "reflink.h"
#include "subpage.h"
#include "fs.h"
#include "accessors.h"
static struct kmem_cache *btrfs_inode_defrag_cachep;
/*

View File

@ -26,6 +26,7 @@
#include "discard.h"
#include "subpage.h"
#include "inode-item.h"
#include "accessors.h"
#define BITS_PER_BITMAP (PAGE_SIZE * 8UL)
#define MAX_CACHE_BYTES_PER_GIG SZ_64K

View File

@ -13,6 +13,7 @@
#include "transaction.h"
#include "block-group.h"
#include "fs.h"
#include "accessors.h"
static int __add_block_group_free_space(struct btrfs_trans_handle *trans,
struct btrfs_block_group *block_group,

View File

@ -3,6 +3,7 @@
#include "messages.h"
#include "ctree.h"
#include "fs.h"
#include "accessors.h"
void __btrfs_set_fs_incompat(struct btrfs_fs_info *fs_info, u64 flag,
const char *name)

View File

@ -11,6 +11,7 @@
#include "transaction.h"
#include "print-tree.h"
#include "space-info.h"
#include "accessors.h"
struct btrfs_inode_ref *btrfs_find_name_in_backref(struct extent_buffer *leaf,
int slot, const char *name,

View File

@ -51,6 +51,7 @@
#include "block-group.h"
#include "subpage.h"
#include "fs.h"
#include "accessors.h"
#ifdef CONFIG_64BIT
/* If we have a 32-bit userspace and 64-bit kernel, then the UAPI

View File

@ -12,6 +12,7 @@
#include "ctree.h"
#include "extent_io.h"
#include "locking.h"
#include "accessors.h"
/*
* Lockdep class keys for extent_buffer->lock's in this root. For a given

View File

@ -7,6 +7,7 @@
#include "ctree.h"
#include "disk-io.h"
#include "print-tree.h"
#include "accessors.h"
struct root_name_map {
u64 id;

View File

@ -13,6 +13,7 @@
#include "compression.h"
#include "space-info.h"
#include "fs.h"
#include "accessors.h"
#define BTRFS_PROP_HANDLERS_HT_BITS 8
static DEFINE_HASHTABLE(prop_handlers_ht, BTRFS_PROP_HANDLERS_HT_BITS);

View File

@ -25,6 +25,7 @@
#include "sysfs.h"
#include "tree-mod-log.h"
#include "fs.h"
#include "accessors.h"
/*
* Helpers to access qgroup reservation

View File

@ -12,6 +12,7 @@
#include "delayed-ref.h"
#include "ref-verify.h"
#include "fs.h"
#include "accessors.h"
/*
* Used to keep track the roots and number of refs each root has for a given

View File

@ -11,6 +11,7 @@
#include "reflink.h"
#include "transaction.h"
#include "subpage.h"
#include "accessors.h"
#define BTRFS_MAX_DEDUPE_LEN SZ_16M

View File

@ -29,6 +29,7 @@
#include "inode-item.h"
#include "space-info.h"
#include "fs.h"
#include "accessors.h"
/*
* Relocation overview

View File

@ -13,6 +13,7 @@
#include "print-tree.h"
#include "qgroup.h"
#include "space-info.h"
#include "accessors.h"
/*
* Read a root item from the tree. In case we detect a root item smaller then

View File

@ -22,6 +22,7 @@
#include "block-group.h"
#include "zoned.h"
#include "fs.h"
#include "accessors.h"
/*
* This is only the first step towards a full-features scrub. It reads all

View File

@ -27,6 +27,7 @@
#include "compression.h"
#include "xattr.h"
#include "print-tree.h"
#include "accessors.h"
/*
* Maximum number of references an extent can have in order for us to attempt to

View File

@ -11,6 +11,7 @@
#include "block-group.h"
#include "zoned.h"
#include "fs.h"
#include "accessors.h"
/*
* HOW DOES SPACE RESERVATION WORK

View File

@ -51,6 +51,7 @@
#include "qgroup.h"
#include "raid56.h"
#include "fs.h"
#include "accessors.h"
#define CREATE_TRACE_POINTS
#include <trace/events/btrfs.h>

View File

@ -23,6 +23,7 @@
#include "qgroup.h"
#include "misc.h"
#include "fs.h"
#include "accessors.h"
/*
* Structure name Path

View File

@ -8,6 +8,7 @@
#include "../ctree.h"
#include "../extent_io.h"
#include "../disk-io.h"
#include "../accessors.h"
static int test_btrfs_split_item(u32 sectorsize, u32 nodesize)
{

View File

@ -10,6 +10,7 @@
#include "../free-space-tree.h"
#include "../transaction.h"
#include "../block-group.h"
#include "../accessors.h"
struct free_space_extent {
u64 start;

View File

@ -11,6 +11,7 @@
#include "../extent_io.h"
#include "../volumes.h"
#include "../compression.h"
#include "../accessors.h"
static void insert_extent(struct btrfs_root *root, u64 start, u64 len,
u64 ram_bytes, u64 offset, u64 disk_bytenr,

View File

@ -11,6 +11,7 @@
#include "../qgroup.h"
#include "../backref.h"
#include "../fs.h"
#include "../accessors.h"
static int insert_normal_tree_ref(struct btrfs_root *root, u64 bytenr,
u64 num_bytes, u64 parent, u64 root_objectid)

View File

@ -24,6 +24,7 @@
#include "space-info.h"
#include "zoned.h"
#include "fs.h"
#include "accessors.h"
static struct kmem_cache *btrfs_trans_handle_cachep;

View File

@ -27,6 +27,7 @@
#include "misc.h"
#include "btrfs_inode.h"
#include "fs.h"
#include "accessors.h"
/*
* Error message should follow the following format:

View File

@ -9,6 +9,7 @@
#include "print-tree.h"
#include "transaction.h"
#include "locking.h"
#include "accessors.h"
/*
* Defrag all the leaves in a given btree.

View File

@ -4,6 +4,7 @@
#include "tree-mod-log.h"
#include "disk-io.h"
#include "fs.h"
#include "accessors.h"
struct tree_mod_root {
u64 logical;

View File

@ -11,7 +11,7 @@
#include "disk-io.h"
#include "print-tree.h"
#include "fs.h"
#include "accessors.h"
static void btrfs_uuid_to_key(u8 *uuid, u8 type, struct btrfs_key *key)
{

View File

@ -17,6 +17,7 @@
#include "disk-io.h"
#include "locking.h"
#include "fs.h"
#include "accessors.h"
/*
* Implementation of the interface defined in struct fsverity_operations.

View File

@ -34,6 +34,7 @@
#include "discard.h"
#include "zoned.h"
#include "fs.h"
#include "accessors.h"
static struct bio_set btrfs_bioset;

View File

@ -21,6 +21,7 @@
#include "disk-io.h"
#include "props.h"
#include "locking.h"
#include "accessors.h"
int btrfs_getxattr(struct inode *inode, const char *name,
void *buffer, size_t size)

View File

@ -16,6 +16,7 @@
#include "dev-replace.h"
#include "space-info.h"
#include "fs.h"
#include "accessors.h"
/* Maximum number of zones to report per blkdev_report_zones() call */
#define BTRFS_REPORT_NR_ZONES 4096