summaryrefslogtreecommitdiff
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2018-04-05 01:29:24 +0200
committerDavid Sterba <dsterba@suse.com>2018-12-17 14:51:44 +0100
commit129827e3001fd1e6892a0629b48f9c7c91cbb8b6 (patch)
tree2a99d8de69cd3d439d96a384d41da62ac083e6c1 /fs/btrfs/ctree.h
parentceb21a8db48559fd0809e03c4df9eb37743d9170 (diff)
btrfs: dev-replace: swich locking to rw semaphore
This is the first part of removing the custom locking and waiting scheme used for device replace. It was probably copied from extent buffer locking, but there's nothing that would require more than is provided by the common locking primitives. The rw spinlock protects waiting tasks counter in case of incompatible locks and the waitqueue. Same as rw semaphore. This patch only switches the locking primitive, for better bisectability. There should be no functional change other than the overhead of the locking and potential sleeping instead of spinning when the lock is contended. Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r--fs/btrfs/ctree.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 81cbbb24678e..b4f97120aecd 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -378,7 +378,7 @@ struct btrfs_dev_replace {
struct btrfs_device *tgtdev;
struct mutex lock_finishing_cancel_unmount;
- rwlock_t lock;
+ struct rw_semaphore rwsem;
atomic_t blocking_readers;
wait_queue_head_t read_lock_wq;