summaryrefslogtreecommitdiff
path: root/drivers/block/drbd/drbd_proc.c
diff options
context:
space:
mode:
authorPhilipp Reisner <philipp.reisner@linbit.com>2011-05-05 18:13:10 +0400
committerPhilipp Reisner <philipp.reisner@linbit.com>2012-11-08 19:55:48 +0400
commitc141ebda031a0550d75634f7c94f7c85c2d5c9f5 (patch)
treedd514cc2bf29f73a00e677b963950b2f349a0042 /drivers/block/drbd/drbd_proc.c
parentec0bddbc5574ea5903cec8f30ed57777f14d86a8 (diff)
downloadlinux-c141ebda031a0550d75634f7c94f7c85c2d5c9f5.tar.xz
drbd: Removing drbd_cfg_rwsem
* Updates to all configuration items is done under genl_lock(). Including removal of mdevs or tconns. * All read non sleeping read sides are protected by rcu * All sleeping read sides keep reference counts to keep the objects alive Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd/drbd_proc.c')
-rw-r--r--drivers/block/drbd/drbd_proc.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/block/drbd/drbd_proc.c b/drivers/block/drbd/drbd_proc.c
index 792a71ec2e69..6b226cca1e83 100644
--- a/drivers/block/drbd/drbd_proc.c
+++ b/drivers/block/drbd/drbd_proc.c
@@ -229,7 +229,7 @@ static int drbd_seq_show(struct seq_file *seq, void *v)
oos .. known out-of-sync kB
*/
- down_read(&drbd_cfg_rwsem);
+ rcu_read_lock();
idr_for_each_entry(&minors, mdev, i) {
if (prev_i != i - 1)
seq_printf(seq, "\n");
@@ -242,10 +242,8 @@ static int drbd_seq_show(struct seq_file *seq, void *v)
mdev->state.role == R_SECONDARY) {
seq_printf(seq, "%2d: cs:Unconfigured\n", i);
} else {
- rcu_read_lock();
nc = rcu_dereference(mdev->tconn->net_conf);
wp = nc ? nc->wire_protocol - DRBD_PROT_A + 'A' : ' ';
- rcu_read_unlock();
seq_printf(seq,
"%2d: cs:%s ro:%s/%s ds:%s/%s %c %c%c%c%c%c%c\n"
" ns:%u nr:%u dw:%u dr:%u al:%u bm:%u "
@@ -299,7 +297,7 @@ static int drbd_seq_show(struct seq_file *seq, void *v)
}
}
}
- up_read(&drbd_cfg_rwsem);
+ rcu_read_unlock();
return 0;
}