diff options
Diffstat (limited to 'drivers/block/rbd.c')
-rw-r--r-- | drivers/block/rbd.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 38174bffa049..92b8c374d84d 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c | |||
@@ -179,8 +179,8 @@ static DEFINE_MUTEX(ctl_mutex); /* Serialize open/close/setup/teardown */ | |||
179 | static LIST_HEAD(rbd_dev_list); /* devices */ | 179 | static LIST_HEAD(rbd_dev_list); /* devices */ |
180 | static DEFINE_SPINLOCK(rbd_dev_list_lock); | 180 | static DEFINE_SPINLOCK(rbd_dev_list_lock); |
181 | 181 | ||
182 | static LIST_HEAD(rbd_client_list); /* clients */ | 182 | static LIST_HEAD(rbd_client_list); /* clients */ |
183 | static DEFINE_SPINLOCK(node_lock); /* protects client get/put */ | 183 | static DEFINE_SPINLOCK(rbd_client_list_lock); |
184 | 184 | ||
185 | static int __rbd_init_snaps_header(struct rbd_device *rbd_dev); | 185 | static int __rbd_init_snaps_header(struct rbd_device *rbd_dev); |
186 | static void rbd_dev_release(struct device *dev); | 186 | static void rbd_dev_release(struct device *dev); |
@@ -270,9 +270,9 @@ static struct rbd_client *rbd_client_create(struct ceph_options *opt, | |||
270 | 270 | ||
271 | rbdc->rbd_opts = rbd_opts; | 271 | rbdc->rbd_opts = rbd_opts; |
272 | 272 | ||
273 | spin_lock(&node_lock); | 273 | spin_lock(&rbd_client_list_lock); |
274 | list_add_tail(&rbdc->node, &rbd_client_list); | 274 | list_add_tail(&rbdc->node, &rbd_client_list); |
275 | spin_unlock(&node_lock); | 275 | spin_unlock(&rbd_client_list_lock); |
276 | 276 | ||
277 | mutex_unlock(&ctl_mutex); | 277 | mutex_unlock(&ctl_mutex); |
278 | 278 | ||
@@ -385,12 +385,12 @@ static int rbd_get_client(struct rbd_device *rbd_dev, const char *mon_addr, | |||
385 | goto done_err; | 385 | goto done_err; |
386 | } | 386 | } |
387 | 387 | ||
388 | spin_lock(&node_lock); | 388 | spin_lock(&rbd_client_list_lock); |
389 | rbdc = __rbd_client_find(opt); | 389 | rbdc = __rbd_client_find(opt); |
390 | if (rbdc) { | 390 | if (rbdc) { |
391 | /* using an existing client */ | 391 | /* using an existing client */ |
392 | kref_get(&rbdc->kref); | 392 | kref_get(&rbdc->kref); |
393 | spin_unlock(&node_lock); | 393 | spin_unlock(&rbd_client_list_lock); |
394 | 394 | ||
395 | rbd_dev->rbd_client = rbdc; | 395 | rbd_dev->rbd_client = rbdc; |
396 | 396 | ||
@@ -399,7 +399,7 @@ static int rbd_get_client(struct rbd_device *rbd_dev, const char *mon_addr, | |||
399 | 399 | ||
400 | return 0; | 400 | return 0; |
401 | } | 401 | } |
402 | spin_unlock(&node_lock); | 402 | spin_unlock(&rbd_client_list_lock); |
403 | 403 | ||
404 | rbdc = rbd_client_create(opt, rbd_opts); | 404 | rbdc = rbd_client_create(opt, rbd_opts); |
405 | 405 | ||
@@ -418,7 +418,7 @@ done_err: | |||
418 | /* | 418 | /* |
419 | * Destroy ceph client | 419 | * Destroy ceph client |
420 | * | 420 | * |
421 | * Caller must hold node_lock. | 421 | * Caller must hold rbd_client_list_lock. |
422 | */ | 422 | */ |
423 | static void rbd_client_release(struct kref *kref) | 423 | static void rbd_client_release(struct kref *kref) |
424 | { | 424 | { |
@@ -438,9 +438,9 @@ static void rbd_client_release(struct kref *kref) | |||
438 | */ | 438 | */ |
439 | static void rbd_put_client(struct rbd_device *rbd_dev) | 439 | static void rbd_put_client(struct rbd_device *rbd_dev) |
440 | { | 440 | { |
441 | spin_lock(&node_lock); | 441 | spin_lock(&rbd_client_list_lock); |
442 | kref_put(&rbd_dev->rbd_client->kref, rbd_client_release); | 442 | kref_put(&rbd_dev->rbd_client->kref, rbd_client_release); |
443 | spin_unlock(&node_lock); | 443 | spin_unlock(&rbd_client_list_lock); |
444 | rbd_dev->rbd_client = NULL; | 444 | rbd_dev->rbd_client = NULL; |
445 | } | 445 | } |
446 | 446 | ||