btrfs-progs: update arguments of find_extent_buffer

In the kernel we only take a bytenr for this as the extent buffer cache
is indexed on bytenr.  Since we're passing in the btrfs_fs_info we can
simply use the ->nodesize for the blocksize, and drop the blocksize
argument completely.  This brings us into parity with the kernel, which
will allow the syncing of ctree.c.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Josef Bacik 2023-04-19 17:24:02 -04:00 committed by David Sterba
parent d1bafa2324
commit 5d84ee58e9
3 changed files with 6 additions and 5 deletions

View file

@ -228,7 +228,7 @@ static int csum_tree_block(struct btrfs_fs_info *fs_info,
struct extent_buffer *btrfs_find_tree_block(struct btrfs_fs_info *fs_info,
u64 bytenr, u32 blocksize)
{
return find_extent_buffer(fs_info, bytenr, blocksize);
return find_extent_buffer(fs_info, bytenr);
}
struct extent_buffer* btrfs_find_create_tree_block(

View file

@ -210,14 +210,15 @@ void free_extent_buffer_stale(struct extent_buffer *eb)
}
struct extent_buffer *find_extent_buffer(struct btrfs_fs_info *fs_info,
u64 bytenr, u32 blocksize)
u64 bytenr)
{
struct extent_buffer *eb = NULL;
struct cache_extent *cache;
cache = lookup_cache_extent(&fs_info->extent_cache, bytenr, blocksize);
cache = lookup_cache_extent(&fs_info->extent_cache, bytenr,
fs_info->nodesize);
if (cache && cache->start == bytenr &&
cache->size == blocksize) {
cache->size == fs_info->nodesize) {
eb = container_of(cache, struct extent_buffer, cache_node);
list_move_tail(&eb->lru, &fs_info->lru);
eb->refs++;

View file

@ -94,7 +94,7 @@ static inline int extent_buffer_uptodate(struct extent_buffer *eb)
}
struct extent_buffer *find_extent_buffer(struct btrfs_fs_info *fs_info,
u64 bytenr, u32 blocksize);
u64 bytenr);
struct extent_buffer *find_first_extent_buffer(struct btrfs_fs_info *fs_info,
u64 start);
struct extent_buffer *alloc_extent_buffer(struct btrfs_fs_info *fs_info,