diff options
author | Qu Wenruo <quwenruo@cn.fujitsu.com> | 2017-05-18 09:17:41 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2017-07-03 13:35:10 +0200 |
commit | 34bd20793247de30e712bd411c287c5831f9aa32 (patch) | |
tree | 1afe0b413cc09e19f1b4583e56b23cbdd09e8013 | |
parent | 3d5eadd63383db1c83dd849ac08190856120868f (diff) |
btrfs-progs: Refactor block sizes users in ctree.c and ctree.h
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
-rw-r--r-- | ctree.c | 10 | ||||
-rw-r--r-- | ctree.h | 4 |
2 files changed, 7 insertions, 7 deletions
@@ -650,7 +650,7 @@ struct extent_buffer *read_node_slot(struct btrfs_root *root, return NULL; return read_tree_block(root, btrfs_node_blockptr(parent, slot), - root->nodesize, + root->fs_info->nodesize, btrfs_node_ptr_generation(parent, slot)); } @@ -987,7 +987,7 @@ void reada_for_search(struct btrfs_root *root, struct btrfs_path *path, node = path->nodes[level]; search = btrfs_node_blockptr(node, slot); - blocksize = root->nodesize; + blocksize = root->fs_info->nodesize; eb = btrfs_find_tree_block(root, search, blocksize); if (eb) { free_extent_buffer(eb); @@ -1420,7 +1420,7 @@ static int noinline insert_new_root(struct btrfs_trans_handle *trans, else btrfs_node_key(lower, &lower_key, 0); - c = btrfs_alloc_free_block(trans, root, root->nodesize, + c = btrfs_alloc_free_block(trans, root, root->fs_info->nodesize, root->root_key.objectid, &lower_key, level, root->node->start, 0); @@ -1543,7 +1543,7 @@ static int split_node(struct btrfs_trans_handle *trans, struct btrfs_root mid = (c_nritems + 1) / 2; btrfs_node_key(c, &disk_key, mid); - split = btrfs_alloc_free_block(trans, root, root->nodesize, + split = btrfs_alloc_free_block(trans, root, root->fs_info->nodesize, root->root_key.objectid, &disk_key, level, c->start, 0); if (IS_ERR(split)) @@ -2110,7 +2110,7 @@ again: else btrfs_item_key(l, &disk_key, mid); - right = btrfs_alloc_free_block(trans, root, root->nodesize, + right = btrfs_alloc_free_block(trans, root, root->fs_info->nodesize, root->root_key.objectid, &disk_key, 0, l->start, 0); if (IS_ERR(right)) { @@ -352,11 +352,11 @@ struct btrfs_header { u8 level; } __attribute__ ((__packed__)); -#define BTRFS_NODEPTRS_PER_BLOCK(r) (((r)->nodesize - \ +#define BTRFS_NODEPTRS_PER_BLOCK(r) (((r)->fs_info->nodesize - \ sizeof(struct btrfs_header)) / \ sizeof(struct btrfs_key_ptr)) #define __BTRFS_LEAF_DATA_SIZE(bs) ((bs) - sizeof(struct btrfs_header)) -#define BTRFS_LEAF_DATA_SIZE(r) (__BTRFS_LEAF_DATA_SIZE(r->nodesize)) +#define BTRFS_LEAF_DATA_SIZE(r) (__BTRFS_LEAF_DATA_SIZE(r->fs_info->nodesize)) #define BTRFS_MAX_INLINE_DATA_SIZE(r) (BTRFS_LEAF_DATA_SIZE(r) - \ sizeof(struct btrfs_item) - \ sizeof(struct btrfs_file_extent_item)) |