Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 253086
b: refs/heads/master
c: 026fd31
h: refs/heads/master
v: v3
  • Loading branch information
Josef Bacik committed May 23, 2011
1 parent 25c4cf1 commit 3599d1b
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 589d8ade83f07c0f11c8191c0ca309f34d7a2c14
refs/heads/master: 026fd317828500524cdc7e5ff9e8e7923abb2868
2 changes: 0 additions & 2 deletions trunk/fs/btrfs/ctree.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ struct btrfs_path *btrfs_alloc_path(void)
{
struct btrfs_path *path;
path = kmem_cache_zalloc(btrfs_path_cachep, GFP_NOFS);
if (path)
path->reada = 1;
return path;
}

Expand Down
3 changes: 2 additions & 1 deletion trunk/fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ static int caching_kthread(void *data)
*/
path->skip_locking = 1;
path->search_commit_root = 1;
path->reada = 2;
path->reada = 1;

key.objectid = last;
key.offset = 0;
Expand Down Expand Up @@ -8556,6 +8556,7 @@ int btrfs_read_block_groups(struct btrfs_root *root)
path = btrfs_alloc_path();
if (!path)
return -ENOMEM;
path->reada = 1;

cache_gen = btrfs_super_cache_generation(&root->fs_info->super_copy);
if (cache_gen != 0 &&
Expand Down
14 changes: 12 additions & 2 deletions trunk/fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -4242,7 +4242,9 @@ static int btrfs_real_readdir(struct file *filp, void *dirent,
filp->f_pos = 2;
}
path = btrfs_alloc_path();
path->reada = 2;
if (!path)
return -ENOMEM;
path->reada = 1;

btrfs_set_key_type(&key, key_type);
key.offset = filp->f_pos;
Expand Down Expand Up @@ -5043,7 +5045,15 @@ struct extent_map *btrfs_get_extent(struct inode *inode, struct page *page,

if (!path) {
path = btrfs_alloc_path();
BUG_ON(!path);
if (!path) {
err = -ENOMEM;
goto out;
}
/*
* Chances are we'll be called again, so go ahead and do
* readahead
*/
path->reada = 1;
}

ret = btrfs_lookup_file_extent(trans, root, path,
Expand Down
6 changes: 6 additions & 0 deletions trunk/fs/btrfs/relocation.c
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,8 @@ struct backref_node *build_backref_tree(struct reloc_control *rc,
err = -ENOMEM;
goto out;
}
path1->reada = 1;
path2->reada = 2;

node = alloc_backref_node(cache);
if (!node) {
Expand Down Expand Up @@ -1996,6 +1998,7 @@ static noinline_for_stack int merge_reloc_root(struct reloc_control *rc,
path = btrfs_alloc_path();
if (!path)
return -ENOMEM;
path->reada = 1;

reloc_root = root->reloc_root;
root_item = &reloc_root->root_item;
Expand Down Expand Up @@ -3297,6 +3300,7 @@ static int find_data_references(struct reloc_control *rc,
path = btrfs_alloc_path();
if (!path)
return -ENOMEM;
path->reada = 1;

root = read_fs_root(rc->extent_root->fs_info, ref_root);
if (IS_ERR(root)) {
Expand Down Expand Up @@ -3665,6 +3669,7 @@ static noinline_for_stack int relocate_block_group(struct reloc_control *rc)
path = btrfs_alloc_path();
if (!path)
return -ENOMEM;
path->reada = 1;

ret = prepare_to_relocate(rc);
if (ret) {
Expand Down Expand Up @@ -4090,6 +4095,7 @@ int btrfs_recover_relocation(struct btrfs_root *root)
path = btrfs_alloc_path();
if (!path)
return -ENOMEM;
path->reada = -1;

key.objectid = BTRFS_TREE_RELOC_OBJECTID;
key.type = BTRFS_ROOT_ITEM_KEY;
Expand Down

0 comments on commit 3599d1b

Please sign in to comment.