]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: dev-replace: swich locking to rw semaphore
authorDavid Sterba <dsterba@suse.com>
Wed, 4 Apr 2018 23:29:24 +0000 (01:29 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 17 Dec 2018 13:51:44 +0000 (14:51 +0100)
commitb4fdca4061220519f992131a9d4dd246d9b0e80d
tree2a99d8de69cd3d439d96a384d41da62ac083e6c1
parent8326b72345599f84d10eb7cd632468244861a3b1
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>
fs/btrfs/ctree.h
fs/btrfs/dev-replace.c
fs/btrfs/disk-io.c