diff options
author | Alex Elder <elder@dreamhost.com> | 2012-01-29 14:57:44 -0500 |
---|---|---|
committer | Alex Elder <elder@dreamhost.com> | 2012-03-22 11:47:47 -0400 |
commit | e6994d3ddedf1a9f35cb43655bb4b5810e71199a (patch) | |
tree | 0e0af19765412596516550b3a95c32ff67be6d47 /drivers | |
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')
-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, | |||
383 | spin_lock(&node_lock); | 383 | spin_lock(&node_lock); |
384 | rbdc = __rbd_client_find(opt); | 384 | rbdc = __rbd_client_find(opt); |
385 | if (rbdc) { | 385 | if (rbdc) { |
386 | ceph_destroy_options(opt); | ||
387 | kfree(rbd_opts); | ||
388 | |||
389 | /* using an existing client */ | 386 | /* using an existing client */ |
390 | kref_get(&rbdc->kref); | 387 | kref_get(&rbdc->kref); |
391 | rbd_dev->rbd_client = rbdc; | ||
392 | spin_unlock(&node_lock); | 388 | spin_unlock(&node_lock); |
389 | |||
390 | rbd_dev->rbd_client = rbdc; | ||
391 | |||
392 | ceph_destroy_options(opt); | ||
393 | kfree(rbd_opts); | ||
394 | |||
393 | return 0; | 395 | return 0; |
394 | } | 396 | } |
395 | spin_unlock(&node_lock); | 397 | spin_unlock(&node_lock); |