drbd: Fix locking across all resources
authorAndreas Gruenbacher <agruen@linbit.com>
Thu, 14 Aug 2014 16:33:30 +0000 (18:33 +0200)
committerJens Axboe <axboe@fb.com>
Wed, 25 Nov 2015 16:22:00 +0000 (09:22 -0700)
commit28bc3b8c71cda033a4c013131c635d1148889824
treeceb03e905cdee0d06cd169f8affe46f722fd14d8
parent1ec317d3d1f9b9ec19926fdf2fc59fa3ec8cd15d
drbd: Fix locking across all resources

Instead of using a rwlock for synchronizing state changes across
resources, take the request locks of all resources for global state
changes.  Use resources_mutex to serialize global state changes.

This means that taking the request lock of a resource is now enough to
prevent changes of that resource.  (Previously, a read lock on the
global state lock was needed as well.)

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/block/drbd/drbd_int.h
drivers/block/drbd/drbd_main.c
drivers/block/drbd/drbd_nl.c
drivers/block/drbd/drbd_state.c
drivers/block/drbd/drbd_state.h
drivers/block/drbd/drbd_worker.c