Commit e6994d3d authored by Alex Elder's avatar Alex Elder

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: default avatarAlex Elder <elder@dreamhost.com>
Signed-off-by: default avatarSage Weil <sage@newdream.net>
parent d184f6bf
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment