]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: Stop using call_rcu for device freeing
authorNikolay Borisov <nborisov@suse.com>
Wed, 27 Mar 2019 12:24:11 +0000 (14:24 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 29 Apr 2019 17:02:37 +0000 (19:02 +0200)
commit4ff4d0adc169fb32f6e9d42f7b90b828c043ee54
tree1b4985f7563cc2a6a1877e03e3178d202342a7a0
parent61bdccc5f9400baadb2c018c05cf8a99e104b6b4
btrfs: Stop using call_rcu for device freeing

btrfs_device structs are freed from RCU context since device iteration
is protected by RCU. Currently this is achieved by using call_rcu since
no blocking functions are called within btrfs_free_device. Future
refactoring of pending/pinned chunks will require calling sleeping
functions.

This patch is in preparation for these changes by simply switching from
RCU callbacks to explicit calls of synchronize_rcu and calling
btrfs_free_device directly. This is functionally equivalent, making sure
that there are no readers at that time.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/volumes.c
fs/btrfs/volumes.h