From: Alex Elder Date: Sun, 29 Jan 2012 19:57:44 +0000 (-0600) Subject: rbd: release client list lock sooner X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=e6994d3ddedf1a9f35cb43655bb4b5810e71199a;p=linux-beck.git 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 Signed-off-by: Sage Weil --- 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);