Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 260898
b: refs/heads/master
c: 31533fb
h: refs/heads/master
v: v3
  • Loading branch information
Chris Mason committed Jul 27, 2011
1 parent 27941d9 commit df5e64f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 32 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: 85d4e461117b40eb10722f774566b19bd5e77879
refs/heads/master: 31533fb263928c93a34cda41b66a6e83ade5c766
36 changes: 5 additions & 31 deletions trunk/fs/btrfs/ctree.c
Original file line number Diff line number Diff line change
Expand Up @@ -4169,21 +4169,12 @@ int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path)
u32 nritems;
int ret;
int old_spinning = path->leave_spinning;
int force_blocking = 0;
int next_rw_lock = 0;

nritems = btrfs_header_nritems(path->nodes[0]);
if (nritems == 0)
return 1;

/*
* we take the blocks in an order that upsets lockdep. Using
* blocking mode is the only way around it.
*/
#ifdef CONFIG_DEBUG_LOCK_ALLOC
force_blocking = 1;
#endif

btrfs_item_key_to_cpu(path->nodes[0], &key, nritems - 1);
again:
level = 1;
Expand All @@ -4192,9 +4183,7 @@ int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path)
btrfs_release_path(path);

path->keep_locks = 1;

if (!force_blocking)
path->leave_spinning = 1;
path->leave_spinning = 1;

ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
path->keep_locks = 0;
Expand Down Expand Up @@ -4255,18 +4244,10 @@ int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path)
if (!ret) {
btrfs_set_path_blocking(path);
btrfs_tree_read_lock(next);
if (!force_blocking) {
btrfs_clear_path_blocking(path, next,
btrfs_clear_path_blocking(path, next,
BTRFS_READ_LOCK);
}
}
if (force_blocking) {
btrfs_set_lock_blocking_rw(next,
BTRFS_READ_LOCK);
next_rw_lock = BTRFS_READ_LOCK_BLOCKING;
} else {
next_rw_lock = BTRFS_READ_LOCK;
}
next_rw_lock = BTRFS_READ_LOCK;
}
break;
}
Expand Down Expand Up @@ -4300,17 +4281,10 @@ int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path)
if (!ret) {
btrfs_set_path_blocking(path);
btrfs_tree_read_lock(next);
if (!force_blocking)
btrfs_clear_path_blocking(path, next,
btrfs_clear_path_blocking(path, next,
BTRFS_READ_LOCK);
}
if (force_blocking) {
btrfs_set_lock_blocking_rw(next,
BTRFS_READ_LOCK);
next_rw_lock = BTRFS_READ_LOCK_BLOCKING;
} else {
next_rw_lock = BTRFS_READ_LOCK;
}
next_rw_lock = BTRFS_READ_LOCK;
}
}
ret = 0;
Expand Down

0 comments on commit df5e64f

Please sign in to comment.