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>
This commit is contained in:
Alex Elder 2012-01-29 13:57:44 -06:00
parent d184f6bfde
commit e6994d3dde

View File

@ -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) {
/* using an existing client */
kref_get(&rbdc->kref);
spin_unlock(&node_lock);
rbd_dev->rbd_client = 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);
return 0;
}
spin_unlock(&node_lock);