aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
authorChris Mason <clm@fb.com>2014-10-04 12:57:14 -0400
committerChris Mason <clm@fb.com>2014-10-04 12:57:14 -0400
commit27b19cc8864e206c4203041892b0f706f044a0f1 (patch)
treef724dd77efa379da881fba7f46075af17a728bf9 /fs/btrfs/extent-tree.c
parentbbf65cf0b5b67843ca094df01019222b85af2183 (diff)
parent4d75f8a9c87b843c8ded15b82b8d137b9724cccc (diff)
Merge branch 'cleanup/blocksize-diet-part1' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux into for-linus
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 23940cc207e8..9a5effa32a66 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -7323,8 +7323,8 @@ static void unuse_block_rsv(struct btrfs_fs_info *fs_info,
7323 * 7323 *
7324 * returns the tree buffer or NULL. 7324 * returns the tree buffer or NULL.
7325 */ 7325 */
7326struct extent_buffer *btrfs_alloc_free_block(struct btrfs_trans_handle *trans, 7326struct extent_buffer *btrfs_alloc_tree_block(struct btrfs_trans_handle *trans,
7327 struct btrfs_root *root, u32 blocksize, 7327 struct btrfs_root *root,
7328 u64 parent, u64 root_objectid, 7328 u64 parent, u64 root_objectid,
7329 struct btrfs_disk_key *key, int level, 7329 struct btrfs_disk_key *key, int level,
7330 u64 hint, u64 empty_size) 7330 u64 hint, u64 empty_size)
@@ -7334,6 +7334,7 @@ struct extent_buffer *btrfs_alloc_free_block(struct btrfs_trans_handle *trans,
7334 struct extent_buffer *buf; 7334 struct extent_buffer *buf;
7335 u64 flags = 0; 7335 u64 flags = 0;
7336 int ret; 7336 int ret;
7337 u32 blocksize = root->nodesize;
7337 bool skinny_metadata = btrfs_fs_incompat(root->fs_info, 7338 bool skinny_metadata = btrfs_fs_incompat(root->fs_info,
7338 SKINNY_METADATA); 7339 SKINNY_METADATA);
7339 7340
@@ -7486,10 +7487,7 @@ static noinline void reada_walk_down(struct btrfs_trans_handle *trans,
7486 continue; 7487 continue;
7487 } 7488 }
7488reada: 7489reada:
7489 ret = readahead_tree_block(root, bytenr, blocksize, 7490 readahead_tree_block(root, bytenr, blocksize);
7490 generation);
7491 if (ret)
7492 break;
7493 nread++; 7491 nread++;
7494 } 7492 }
7495 wc->reada_slot = slot; 7493 wc->reada_slot = slot;
@@ -7648,7 +7646,6 @@ walk_down:
7648 level = root_level; 7646 level = root_level;
7649 while (level >= 0) { 7647 while (level >= 0) {
7650 if (path->nodes[level] == NULL) { 7648 if (path->nodes[level] == NULL) {
7651 int child_bsize = root->nodesize;
7652 int parent_slot; 7649 int parent_slot;
7653 u64 child_gen; 7650 u64 child_gen;
7654 u64 child_bytenr; 7651 u64 child_bytenr;
@@ -7660,8 +7657,7 @@ walk_down:
7660 child_bytenr = btrfs_node_blockptr(eb, parent_slot); 7657 child_bytenr = btrfs_node_blockptr(eb, parent_slot);
7661 child_gen = btrfs_node_ptr_generation(eb, parent_slot); 7658 child_gen = btrfs_node_ptr_generation(eb, parent_slot);
7662 7659
7663 eb = read_tree_block(root, child_bytenr, child_bsize, 7660 eb = read_tree_block(root, child_bytenr, child_gen);
7664 child_gen);
7665 if (!eb || !extent_buffer_uptodate(eb)) { 7661 if (!eb || !extent_buffer_uptodate(eb)) {
7666 ret = -EIO; 7662 ret = -EIO;
7667 goto out; 7663 goto out;
@@ -7677,7 +7673,7 @@ walk_down:
7677 ret = btrfs_qgroup_record_ref(trans, root->fs_info, 7673 ret = btrfs_qgroup_record_ref(trans, root->fs_info,
7678 root->objectid, 7674 root->objectid,
7679 child_bytenr, 7675 child_bytenr,
7680 child_bsize, 7676 root->nodesize,
7681 BTRFS_QGROUP_OPER_SUB_SUBTREE, 7677 BTRFS_QGROUP_OPER_SUB_SUBTREE,
7682 0); 7678 0);
7683 if (ret) 7679 if (ret)
@@ -7830,7 +7826,7 @@ static noinline int do_walk_down(struct btrfs_trans_handle *trans,
7830 bytenr = btrfs_node_blockptr(path->nodes[level], path->slots[level]); 7826 bytenr = btrfs_node_blockptr(path->nodes[level], path->slots[level]);
7831 blocksize = root->nodesize; 7827 blocksize = root->nodesize;
7832 7828
7833 next = btrfs_find_tree_block(root, bytenr, blocksize); 7829 next = btrfs_find_tree_block(root, bytenr);
7834 if (!next) { 7830 if (!next) {
7835 next = btrfs_find_create_tree_block(root, bytenr, blocksize); 7831 next = btrfs_find_create_tree_block(root, bytenr, blocksize);
7836 if (!next) 7832 if (!next)
@@ -7892,7 +7888,7 @@ static noinline int do_walk_down(struct btrfs_trans_handle *trans,
7892 if (!next) { 7888 if (!next) {
7893 if (reada && level == 1) 7889 if (reada && level == 1)
7894 reada_walk_down(trans, root, wc, path); 7890 reada_walk_down(trans, root, wc, path);
7895 next = read_tree_block(root, bytenr, blocksize, generation); 7891 next = read_tree_block(root, bytenr, generation);
7896 if (!next || !extent_buffer_uptodate(next)) { 7892 if (!next || !extent_buffer_uptodate(next)) {
7897 free_extent_buffer(next); 7893 free_extent_buffer(next);
7898 return -EIO; 7894 return -EIO;