提交 e6994d3d 编写于 作者: A 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: NAlex Elder <elder@dreamhost.com>
Signed-off-by: NSage Weil <sage@newdream.net>
上级 d184f6bf
...@@ -383,13 +383,15 @@ static int rbd_get_client(struct rbd_device *rbd_dev, const char *mon_addr, ...@@ -383,13 +383,15 @@ static int rbd_get_client(struct rbd_device *rbd_dev, const char *mon_addr,
spin_lock(&node_lock); spin_lock(&node_lock);
rbdc = __rbd_client_find(opt); rbdc = __rbd_client_find(opt);
if (rbdc) { if (rbdc) {
ceph_destroy_options(opt);
kfree(rbd_opts);
/* using an existing client */ /* using an existing client */
kref_get(&rbdc->kref); kref_get(&rbdc->kref);
rbd_dev->rbd_client = rbdc;
spin_unlock(&node_lock); spin_unlock(&node_lock);
rbd_dev->rbd_client = rbdc;
ceph_destroy_options(opt);
kfree(rbd_opts);
return 0; return 0;
} }
spin_unlock(&node_lock); spin_unlock(&node_lock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册