diff options
author | Filipe Manana <fdmanana@suse.com> | 2022-10-11 13:17:02 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2022-12-05 18:00:39 +0100 |
commit | 61dbb952f0a5f587c983d88853212e969d2d4ede (patch) | |
tree | 0e28d1d2e8a16d2c72afaedb04c595f475d0e854 /fs/btrfs/backref.h | |
parent | ceb707da9ad92ad3a5251dc13844034ded06cb3d (diff) |
btrfs: turn the backref sharedness check cache into a context object
Right now we are using a struct btrfs_backref_shared_cache to pass state
across multiple btrfs_is_data_extent_shared() calls. The structure's name
closely follows its current purpose, which is to cache previous checks
for the sharedness of metadata extents. However we will start using the
structure for more things other than caching sharedness checks, so rename
it to struct btrfs_backref_share_check_ctx.
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/backref.h')
-rw-r--r-- | fs/btrfs/backref.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/btrfs/backref.h b/fs/btrfs/backref.h index c846fa2bdf93..e3a2b45a76e3 100644 --- a/fs/btrfs/backref.h +++ b/fs/btrfs/backref.h @@ -23,13 +23,13 @@ struct btrfs_backref_shared_cache_entry { bool is_shared; }; -struct btrfs_backref_shared_cache { +struct btrfs_backref_share_check_ctx { /* * A path from a root to a leaf that has a file extent item pointing to * a given data extent should never exceed the maximum b+tree height. */ - struct btrfs_backref_shared_cache_entry entries[BTRFS_MAX_LEVEL]; - bool use_cache; + struct btrfs_backref_shared_cache_entry path_cache_entries[BTRFS_MAX_LEVEL]; + bool use_path_cache; }; typedef int (iterate_extent_inodes_t)(u64 inum, u64 offset, u64 root, @@ -80,7 +80,7 @@ int btrfs_find_one_extref(struct btrfs_root *root, u64 inode_objectid, int btrfs_is_data_extent_shared(struct btrfs_inode *inode, u64 bytenr, u64 extent_gen, struct ulist *roots, struct ulist *tmp, - struct btrfs_backref_shared_cache *cache); + struct btrfs_backref_share_check_ctx *ctx); int __init btrfs_prelim_ref_init(void); void __cold btrfs_prelim_ref_exit(void); |