From c141ebda031a0550d75634f7c94f7c85c2d5c9f5 Mon Sep 17 00:00:00 2001 From: Philipp Reisner Date: Thu, 5 May 2011 16:13:10 +0200 Subject: 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 Signed-off-by: Lars Ellenberg --- drivers/block/drbd/drbd_proc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/block/drbd/drbd_proc.c') diff --git a/drivers/block/drbd/drbd_proc.c b/drivers/block/drbd/drbd_proc.c index 792a71e..6b226cc 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; } -- cgit v1.1