aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/volumes.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.cz>2014-06-14 20:39:54 -0400
committerDavid Sterba <dsterba@suse.cz>2014-12-12 12:07:21 -0500
commita83fffb75d09cd3d44167b7fb9c1ab9e2269445f (patch)
tree2b1f04ff36a7e085a3d773217e35813b07298da3 /fs/btrfs/volumes.c
parentfe864576de7fb940b5bd1f8ab8908a08a3416ca0 (diff)
btrfs: sink blocksize parameter to btrfs_find_create_tree_block
Finally it's clear that the requested blocksize is always equal to nodesize, with one exception, the superblock. Superblock has fixed size regardless of the metadata block size, but uses the same helpers to initialize sys array/chunk tree and to work with the chunk items. So it pretends to be an extent_buffer for a moment, btrfs_read_sys_array is full of special cases, we're adding one more. Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r--fs/btrfs/volumes.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 0144790e296e..f0af9cd0814c 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -6247,8 +6247,13 @@ int btrfs_read_sys_array(struct btrfs_root *root)
6247 u32 cur; 6247 u32 cur;
6248 struct btrfs_key key; 6248 struct btrfs_key key;
6249 6249
6250 sb = btrfs_find_create_tree_block(root, BTRFS_SUPER_INFO_OFFSET, 6250 ASSERT(BTRFS_SUPER_INFO_SIZE <= root->nodesize);
6251 BTRFS_SUPER_INFO_SIZE); 6251 /*
6252 * This will create extent buffer of nodesize, superblock size is
6253 * fixed to BTRFS_SUPER_INFO_SIZE. If nodesize > sb size, this will
6254 * overallocate but we can keep it as-is, only the first page is used.
6255 */
6256 sb = btrfs_find_create_tree_block(root, BTRFS_SUPER_INFO_OFFSET);
6252 if (!sb) 6257 if (!sb)
6253 return -ENOMEM; 6258 return -ENOMEM;
6254 btrfs_set_buffer_uptodate(sb); 6259 btrfs_set_buffer_uptodate(sb);