aboutsummaryrefslogtreecommitdiff
path: root/drivers/block/drbd/drbd_state.c
diff options
context:
space:
mode:
authorPhilipp Reisner <philipp.reisner@linbit.com>2011-04-22 15:23:32 +0200
committerPhilipp Reisner <philipp.reisner@linbit.com>2012-11-08 16:49:06 +0100
commit9dc9fbb35733c8ea97fe9b1cfc5499c7a625805c (patch)
tree1bb4c6633fc53abf4b3464386b29aef52edb4366 /drivers/block/drbd/drbd_state.c
parent1d041225999c6f6246494b02d8f9b405155b52e1 (diff)
downloadvexpress-lsk-9dc9fbb35733c8ea97fe9b1cfc5499c7a625805c.tar.gz
drbd: Basic refcounting for drbd_tconn
References hold by: * Each (running) drbd thread has a reference on tconn * Each mdev has a referenc on tconn * Beeing in the all_tconn list counts for one reference * Each after_conn_state_chg_work has a reference to tconn 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_state.c')
-rw-r--r--drivers/block/drbd/drbd_state.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/block/drbd/drbd_state.c b/drivers/block/drbd/drbd_state.c
index f20a4a3807e..d7a330e0135 100644
--- a/drivers/block/drbd/drbd_state.c
+++ b/drivers/block/drbd/drbd_state.c
@@ -1460,6 +1460,7 @@ static int w_after_conn_state_ch(struct drbd_work *w, int unused)
//conn_err(tconn, STATE_FMT, STATE_ARGS("nms", nms));
after_all_state_ch(tconn);
+ kref_put(&tconn->kref, &conn_destroy);
return 0;
}
@@ -1686,6 +1687,7 @@ _conn_request_state(struct drbd_tconn *tconn, union drbd_state mask, union drbd_
acscw->ns_max = ns_max;
acscw->flags = flags;
acscw->w.cb = w_after_conn_state_ch;
+ kref_get(&tconn->kref);
acscw->w.tconn = tconn;
drbd_queue_work(&tconn->data.work, &acscw->w);
} else {