diff options
author | Alex Elder <elder@dreamhost.com> | 2012-01-29 13:57:44 -0600 |
---|---|---|
committer | Alex Elder <elder@dreamhost.com> | 2012-03-22 10:47:47 -0500 |
commit | e6994d3ddedf1a9f35cb43655bb4b5810e71199a (patch) | |
tree | 0e0af19765412596516550b3a95c32ff67be6d47 /drivers/block/rbd.c | |
parent | d184f6bfde1428ad4a690d49b28afc9ab4d57b35 (diff) |
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/block/rbd.c')
-rw-r--r-- | drivers/block/rbd.c | 10 |
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); |