summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAlex Elder <elder@dreamhost.com>2012-01-29 20:57:44 +0100
committerAlex Elder <elder@dreamhost.com>2012-03-22 16:47:47 +0100
commite6994d3ddedf1a9f35cb43655bb4b5810e71199a (patch)
tree0e0af19765412596516550b3a95c32ff67be6d47 /drivers
parentrbd: restore previous rbd id sequence behavior (diff)
downloadlinux-e6994d3ddedf1a9f35cb43655bb4b5810e71199a.tar.xz
linux-e6994d3ddedf1a9f35cb43655bb4b5810e71199a.zip
rbd: release client list lock sooner
In rbd_get_client(), if a client is reused, a number of things get done while still holding the list lock unnecessarily. This just moves a few things that need no lock protection outside the lock. Signed-off-by: Alex Elder <elder@dreamhost.com> Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/rbd.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 9ac1484a95ad..bccd350a0323 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -383,13 +383,15 @@ static int rbd_get_client(struct rbd_device *rbd_dev, const char *mon_addr,
spin_lock(&node_lock);
rbdc = __rbd_client_find(opt);
if (rbdc) {
- ceph_destroy_options(opt);
- kfree(rbd_opts);
-
/* using an existing client */
kref_get(&rbdc->kref);
- rbd_dev->rbd_client = rbdc;
spin_unlock(&node_lock);
+
+ rbd_dev->rbd_client = rbdc;
+
+ ceph_destroy_options(opt);
+ kfree(rbd_opts);
+
return 0;
}
spin_unlock(&node_lock);