From 6bb4b5bf067fc402c0cbef3631989ee4e7e9329d Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Wed, 12 Dec 2012 17:00:01 -0500 Subject: [PATCH] --- yaml --- r: 346740 b: refs/heads/master c: d6393786cd40f67709324bc4f08d7e4b911153fe h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/btrfs/ctree.c | 7 +++++-- trunk/fs/btrfs/ctree.h | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 40adb02c4d8e..f9b70e3f5839 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b11e234d21e73df94099e473a080bca502b9a496 +refs/heads/master: d6393786cd40f67709324bc4f08d7e4b911153fe diff --git a/trunk/fs/btrfs/ctree.c b/trunk/fs/btrfs/ctree.c index 01efcbc80dfb..0c5c28ff794f 100644 --- a/trunk/fs/btrfs/ctree.c +++ b/trunk/fs/btrfs/ctree.c @@ -2212,6 +2212,9 @@ static noinline void unlock_up(struct btrfs_path *path, int level, int no_skips = 0; struct extent_buffer *t; + if (path->really_keep_locks) + return; + for (i = level; i < BTRFS_MAX_LEVEL; i++) { if (!path->nodes[i]) break; @@ -2259,7 +2262,7 @@ noinline void btrfs_unlock_up_safe(struct btrfs_path *path, int level) { int i; - if (path->keep_locks) + if (path->keep_locks || path->really_keep_locks) return; for (i = level; i < BTRFS_MAX_LEVEL; i++) { @@ -2492,7 +2495,7 @@ int btrfs_search_slot(struct btrfs_trans_handle *trans, struct btrfs_root if (!cow) write_lock_level = -1; - if (cow && (p->keep_locks || p->lowest_level)) + if (cow && (p->really_keep_locks || p->keep_locks || p->lowest_level)) write_lock_level = BTRFS_MAX_LEVEL; min_write_lock_level = write_lock_level; diff --git a/trunk/fs/btrfs/ctree.h b/trunk/fs/btrfs/ctree.h index 313a6adfde55..9ed452f5d062 100644 --- a/trunk/fs/btrfs/ctree.h +++ b/trunk/fs/btrfs/ctree.h @@ -576,6 +576,7 @@ struct btrfs_path { unsigned int skip_locking:1; unsigned int leave_spinning:1; unsigned int search_commit_root:1; + unsigned int really_keep_locks:1; }; /*