diff options
author | Philipp Reisner <philipp.reisner@linbit.com> | 2011-04-19 11:10:19 -0400 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2012-11-08 10:48:59 -0500 |
commit | 44ed167da74825bfb7950d45a4f83bce3e84921c (patch) | |
tree | 5d62fe65143717ff11af26138726540b35953c89 /drivers/block/drbd/drbd_proc.c | |
parent | b032b6fa3528d6eed972db32257cb316a66e0dac (diff) |
drbd: rcu_read_lock() and rcu_dereference() for tconn->net_conf
Removing the get_net_conf()/put_net_conf() calls
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.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/block/drbd/drbd_proc.c b/drivers/block/drbd/drbd_proc.c index 4025d0883bad..792a71ec2e69 100644 --- a/drivers/block/drbd/drbd_proc.c +++ b/drivers/block/drbd/drbd_proc.c | |||
@@ -197,6 +197,8 @@ static int drbd_seq_show(struct seq_file *seq, void *v) | |||
197 | int i, prev_i = -1; | 197 | int i, prev_i = -1; |
198 | const char *sn; | 198 | const char *sn; |
199 | struct drbd_conf *mdev; | 199 | struct drbd_conf *mdev; |
200 | struct net_conf *nc; | ||
201 | char wp; | ||
200 | 202 | ||
201 | static char write_ordering_chars[] = { | 203 | static char write_ordering_chars[] = { |
202 | [WO_none] = 'n', | 204 | [WO_none] = 'n', |
@@ -240,6 +242,10 @@ static int drbd_seq_show(struct seq_file *seq, void *v) | |||
240 | mdev->state.role == R_SECONDARY) { | 242 | mdev->state.role == R_SECONDARY) { |
241 | seq_printf(seq, "%2d: cs:Unconfigured\n", i); | 243 | seq_printf(seq, "%2d: cs:Unconfigured\n", i); |
242 | } else { | 244 | } else { |
245 | rcu_read_lock(); | ||
246 | nc = rcu_dereference(mdev->tconn->net_conf); | ||
247 | wp = nc ? nc->wire_protocol - DRBD_PROT_A + 'A' : ' '; | ||
248 | rcu_read_unlock(); | ||
243 | seq_printf(seq, | 249 | seq_printf(seq, |
244 | "%2d: cs:%s ro:%s/%s ds:%s/%s %c %c%c%c%c%c%c\n" | 250 | "%2d: cs:%s ro:%s/%s ds:%s/%s %c %c%c%c%c%c%c\n" |
245 | " ns:%u nr:%u dw:%u dr:%u al:%u bm:%u " | 251 | " ns:%u nr:%u dw:%u dr:%u al:%u bm:%u " |
@@ -249,8 +255,7 @@ static int drbd_seq_show(struct seq_file *seq, void *v) | |||
249 | drbd_role_str(mdev->state.peer), | 255 | drbd_role_str(mdev->state.peer), |
250 | drbd_disk_str(mdev->state.disk), | 256 | drbd_disk_str(mdev->state.disk), |
251 | drbd_disk_str(mdev->state.pdsk), | 257 | drbd_disk_str(mdev->state.pdsk), |
252 | (mdev->tconn->net_conf == NULL ? ' ' : | 258 | wp, |
253 | (mdev->tconn->net_conf->wire_protocol - DRBD_PROT_A+'A')), | ||
254 | drbd_suspended(mdev) ? 's' : 'r', | 259 | drbd_suspended(mdev) ? 's' : 'r', |
255 | mdev->state.aftr_isp ? 'a' : '-', | 260 | mdev->state.aftr_isp ? 'a' : '-', |
256 | mdev->state.peer_isp ? 'p' : '-', | 261 | mdev->state.peer_isp ? 'p' : '-', |