diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2020-06-03 16:21:35 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2020-06-03 19:56:33 -0400 |
commit | 1952c0790c74e4e81d7066a19aabc5c55a13f10f (patch) | |
tree | 501fa5db6a5f1fd3b2412a2660e995c74ebf0bba /linux/six.c | |
parent | 90d54b388666b258c97be6a4e632824d136356c4 (diff) |
Update bcachefs sources to c9b4a210f9 fixup! bcachefs: Fixes for going RO
Diffstat (limited to 'linux/six.c')
-rw-r--r-- | linux/six.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/linux/six.c b/linux/six.c index c7781235..3d863a9b 100644 --- a/linux/six.c +++ b/linux/six.c @@ -108,7 +108,8 @@ static bool __six_trylock_type(struct six_lock *lock, enum six_lock_type type) if (!do_six_trylock_type(lock, type)) return false; - six_acquire(&lock->dep_map, 1); + if (type != SIX_LOCK_write) + six_acquire(&lock->dep_map, 1); return true; } @@ -130,7 +131,8 @@ static bool __six_relock_type(struct six_lock *lock, enum six_lock_type type, old.v + l[type].lock_val)) != old.v); six_set_owner(lock, type, old); - six_acquire(&lock->dep_map, 1); + if (type != SIX_LOCK_write) + six_acquire(&lock->dep_map, 1); return true; } @@ -323,7 +325,8 @@ static void __six_lock_type_slowpath(struct six_lock *lock, enum six_lock_type t __always_inline static void __six_lock_type(struct six_lock *lock, enum six_lock_type type) { - six_acquire(&lock->dep_map, 0); + if (type != SIX_LOCK_write) + six_acquire(&lock->dep_map, 0); if (!do_six_trylock_type(lock, type)) __six_lock_type_slowpath(lock, type); @@ -382,7 +385,8 @@ static void __six_unlock_type(struct six_lock *lock, enum six_lock_type type) EBUG_ON(type == SIX_LOCK_write && !(lock->state.v & __SIX_LOCK_HELD_intent)); - six_release(&lock->dep_map); + if (type != SIX_LOCK_write) + six_release(&lock->dep_map); if (type == SIX_LOCK_intent) { EBUG_ON(lock->owner != current); |