• David Sterba's avatar
    btrfs: dev-replace: swich locking to rw semaphore · 129827e3
    David Sterba authored
    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: default avatarDavid Sterba <dsterba@suse.com>
    129827e3
dev-replace.c 32.2 KB