aboutsummaryrefslogtreecommitdiff
path: root/drivers/block/drbd/drbd_nl.c
diff options
context:
space:
mode:
authorPhilipp Reisner2011-05-04 15:10:30 +0200
committerPhilipp Reisner2012-11-08 16:55:47 +0100
commit81fa2e675ccf88035d9308a3c98fe2c2928ace00 (patch)
tree492bb7110ef874bbb455fc395f7700f0c7c8277f /drivers/block/drbd/drbd_nl.c
parentbb77d34ecc6fe6cdc3f4f0841a516695c2eacc04 (diff)
drbd: Refcounting for mdev objects
Preparing removal of drbd_cfg_rwsem 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_nl.c')
-rw-r--r--drivers/block/drbd/drbd_nl.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
index 4a946a877bde..5747bc6a7c4c 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
@@ -1065,7 +1065,7 @@ static void conn_reconfig_done(struct drbd_tconn *tconn)
spin_unlock_irq(&tconn->req_lock);
if (stop_threads) {
/* asender is implicitly stopped by receiver
- * in drbd_disconnect() */
+ * in conn_disconnect() */
drbd_thread_stop(&tconn->receiver);
drbd_thread_stop(&tconn->worker);
}
@@ -3033,7 +3033,11 @@ static enum drbd_ret_code adm_delete_minor(struct drbd_conf *mdev)
* we may want to delete a minor from a live replication group.
*/
mdev->state.role == R_SECONDARY) {
- drbd_delete_device(mdev);
+ idr_remove(&mdev->tconn->volumes, mdev->vnr);
+ idr_remove(&minors, mdev_to_minor(mdev));
+ del_gendisk(mdev->vdisk);
+ synchronize_rcu();
+ kref_put(&mdev->kref, &drbd_minor_destroy);
return NO_ERROR;
} else
return ERR_MINOR_CONFIGURED;