btrfs: unify extent buffer allocation api

Make the extent buffer allocation interface consistent.  Cloned eb will
set a valid fs_info.  For dummy eb, we can drop the length parameter and
set it from fs_info.

The built-in sanity checks may pass a NULL fs_info that's queried for
nodesize, but we know it's 4096.

Signed-off-by: David Sterba <dsterba@suse.cz>
This commit is contained in:
David Sterba
2014-06-15 03:20:26 +02:00
parent 23d79d81b1
commit 3f556f7853
6 changed files with 35 additions and 23 deletions

View File

@@ -53,7 +53,7 @@ static int test_btrfs_split_item(void)
return -ENOMEM;
}
path->nodes[0] = eb = alloc_dummy_extent_buffer(0, 4096);
path->nodes[0] = eb = alloc_dummy_extent_buffer(NULL, 4096);
if (!eb) {
test_msg("Could not allocate dummy buffer\n");
ret = -ENOMEM;