diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/ctree.c | 7 | ||||
-rw-r--r-- | fs/btrfs/ctree.h | 1 |
2 files changed, 6 insertions, 2 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 01efcbc80dfb..0c5c28ff794f 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c | |||
@@ -2212,6 +2212,9 @@ static noinline void unlock_up(struct btrfs_path *path, int level, | |||
2212 | int no_skips = 0; | 2212 | int no_skips = 0; |
2213 | struct extent_buffer *t; | 2213 | struct extent_buffer *t; |
2214 | 2214 | ||
2215 | if (path->really_keep_locks) | ||
2216 | return; | ||
2217 | |||
2215 | for (i = level; i < BTRFS_MAX_LEVEL; i++) { | 2218 | for (i = level; i < BTRFS_MAX_LEVEL; i++) { |
2216 | if (!path->nodes[i]) | 2219 | if (!path->nodes[i]) |
2217 | break; | 2220 | break; |
@@ -2259,7 +2262,7 @@ noinline void btrfs_unlock_up_safe(struct btrfs_path *path, int level) | |||
2259 | { | 2262 | { |
2260 | int i; | 2263 | int i; |
2261 | 2264 | ||
2262 | if (path->keep_locks) | 2265 | if (path->keep_locks || path->really_keep_locks) |
2263 | return; | 2266 | return; |
2264 | 2267 | ||
2265 | for (i = level; i < BTRFS_MAX_LEVEL; i++) { | 2268 | for (i = level; i < BTRFS_MAX_LEVEL; i++) { |
@@ -2492,7 +2495,7 @@ int btrfs_search_slot(struct btrfs_trans_handle *trans, struct btrfs_root | |||
2492 | if (!cow) | 2495 | if (!cow) |
2493 | write_lock_level = -1; | 2496 | write_lock_level = -1; |
2494 | 2497 | ||
2495 | if (cow && (p->keep_locks || p->lowest_level)) | 2498 | if (cow && (p->really_keep_locks || p->keep_locks || p->lowest_level)) |
2496 | write_lock_level = BTRFS_MAX_LEVEL; | 2499 | write_lock_level = BTRFS_MAX_LEVEL; |
2497 | 2500 | ||
2498 | min_write_lock_level = write_lock_level; | 2501 | min_write_lock_level = write_lock_level; |
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 313a6adfde55..9ed452f5d062 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -576,6 +576,7 @@ struct btrfs_path { | |||
576 | unsigned int skip_locking:1; | 576 | unsigned int skip_locking:1; |
577 | unsigned int leave_spinning:1; | 577 | unsigned int leave_spinning:1; |
578 | unsigned int search_commit_root:1; | 578 | unsigned int search_commit_root:1; |
579 | unsigned int really_keep_locks:1; | ||
579 | }; | 580 | }; |
580 | 581 | ||
581 | /* | 582 | /* |