Commit ce3e6984 authored by David Sterba's avatar David Sterba

btrfs: sink parameter len to alloc_extent_buffer

Because we're using globally known nodesize. Do the same for the sanity
test function variant.
Signed-off-by: default avatarDavid Sterba <dsterba@suse.cz>
parent 3f556f78
...@@ -1128,9 +1128,8 @@ struct extent_buffer *btrfs_find_create_tree_block(struct btrfs_root *root, ...@@ -1128,9 +1128,8 @@ struct extent_buffer *btrfs_find_create_tree_block(struct btrfs_root *root,
u64 bytenr) u64 bytenr)
{ {
if (btrfs_test_is_dummy_root(root)) if (btrfs_test_is_dummy_root(root))
return alloc_test_extent_buffer(root->fs_info, bytenr, return alloc_test_extent_buffer(root->fs_info, bytenr);
root->nodesize); return alloc_extent_buffer(root->fs_info, bytenr);
return alloc_extent_buffer(root->fs_info, bytenr, root->nodesize);
} }
......
...@@ -4775,7 +4775,7 @@ struct extent_buffer *find_extent_buffer(struct btrfs_fs_info *fs_info, ...@@ -4775,7 +4775,7 @@ struct extent_buffer *find_extent_buffer(struct btrfs_fs_info *fs_info,
#ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS #ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS
struct extent_buffer *alloc_test_extent_buffer(struct btrfs_fs_info *fs_info, struct extent_buffer *alloc_test_extent_buffer(struct btrfs_fs_info *fs_info,
u64 start, unsigned long len) u64 start)
{ {
struct extent_buffer *eb, *exists = NULL; struct extent_buffer *eb, *exists = NULL;
int ret; int ret;
...@@ -4821,8 +4821,9 @@ struct extent_buffer *alloc_test_extent_buffer(struct btrfs_fs_info *fs_info, ...@@ -4821,8 +4821,9 @@ struct extent_buffer *alloc_test_extent_buffer(struct btrfs_fs_info *fs_info,
#endif #endif
struct extent_buffer *alloc_extent_buffer(struct btrfs_fs_info *fs_info, struct extent_buffer *alloc_extent_buffer(struct btrfs_fs_info *fs_info,
u64 start, unsigned long len) u64 start)
{ {
unsigned long len = fs_info->tree_root->nodesize;
unsigned long num_pages = num_extent_pages(start, len); unsigned long num_pages = num_extent_pages(start, len);
unsigned long i; unsigned long i;
unsigned long index = start >> PAGE_CACHE_SHIFT; unsigned long index = start >> PAGE_CACHE_SHIFT;
......
...@@ -262,7 +262,7 @@ int get_state_private(struct extent_io_tree *tree, u64 start, u64 *private); ...@@ -262,7 +262,7 @@ int get_state_private(struct extent_io_tree *tree, u64 start, u64 *private);
void set_page_extent_mapped(struct page *page); void set_page_extent_mapped(struct page *page);
struct extent_buffer *alloc_extent_buffer(struct btrfs_fs_info *fs_info, struct extent_buffer *alloc_extent_buffer(struct btrfs_fs_info *fs_info,
u64 start, unsigned long len); u64 start);
struct extent_buffer *alloc_dummy_extent_buffer(struct btrfs_fs_info *fs_info, struct extent_buffer *alloc_dummy_extent_buffer(struct btrfs_fs_info *fs_info,
u64 start); u64 start);
struct extent_buffer *btrfs_clone_extent_buffer(struct extent_buffer *src); struct extent_buffer *btrfs_clone_extent_buffer(struct extent_buffer *src);
...@@ -378,5 +378,5 @@ noinline u64 find_lock_delalloc_range(struct inode *inode, ...@@ -378,5 +378,5 @@ noinline u64 find_lock_delalloc_range(struct inode *inode,
u64 *end, u64 max_bytes); u64 *end, u64 max_bytes);
#endif #endif
struct extent_buffer *alloc_test_extent_buffer(struct btrfs_fs_info *fs_info, struct extent_buffer *alloc_test_extent_buffer(struct btrfs_fs_info *fs_info,
u64 start, unsigned long len); u64 start);
#endif #endif
...@@ -419,7 +419,7 @@ int btrfs_test_qgroups(void) ...@@ -419,7 +419,7 @@ int btrfs_test_qgroups(void)
* Can't use bytenr 0, some things freak out * Can't use bytenr 0, some things freak out
* *cough*backref walking code*cough* * *cough*backref walking code*cough*
*/ */
root->node = alloc_test_extent_buffer(root->fs_info, 4096, 4096); root->node = alloc_test_extent_buffer(root->fs_info, 4096);
if (!root->node) { if (!root->node) {
test_msg("Couldn't allocate dummy buffer\n"); test_msg("Couldn't allocate dummy buffer\n");
ret = -ENOMEM; ret = -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment