aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2012-07-03 17:01:18 -0400
committerSage Weil <sage@inktank.com>2012-07-30 12:30:08 -0400
commit43ae47011232c1e792d77e78db4a7d0ab05032be (patch)
treee13719bd8415c7a92492b4fdd9d3088961436e39 /drivers/block
parentaded07ea9f7de26e352f679910ac057212ea35e3 (diff)
rbd: option symbol renames
Use the name "ceph_opts" consistently (rather than just "opt") for pointers to a ceph_options structure. Change the few spots that don't use "rbd_opts" for a rbd_options pointer to match the rest. Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/rbd.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 2fe160014f58..cf6f49101794 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -271,9 +271,9 @@ static const struct block_device_operations rbd_bd_ops = {
271 271
272/* 272/*
273 * Initialize an rbd client instance. 273 * Initialize an rbd client instance.
274 * We own *opt. 274 * We own *ceph_opts.
275 */ 275 */
276static struct rbd_client *rbd_client_create(struct ceph_options *opt, 276static struct rbd_client *rbd_client_create(struct ceph_options *ceph_opts,
277 struct rbd_options *rbd_opts) 277 struct rbd_options *rbd_opts)
278{ 278{
279 struct rbd_client *rbdc; 279 struct rbd_client *rbdc;
@@ -289,10 +289,10 @@ static struct rbd_client *rbd_client_create(struct ceph_options *opt,
289 289
290 mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING); 290 mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING);
291 291
292 rbdc->client = ceph_create_client(opt, rbdc, 0, 0); 292 rbdc->client = ceph_create_client(ceph_opts, rbdc, 0, 0);
293 if (IS_ERR(rbdc->client)) 293 if (IS_ERR(rbdc->client))
294 goto out_mutex; 294 goto out_mutex;
295 opt = NULL; /* Now rbdc->client is responsible for opt */ 295 ceph_opts = NULL; /* Now rbdc->client is responsible for ceph_opts */
296 296
297 ret = ceph_open_session(rbdc->client); 297 ret = ceph_open_session(rbdc->client);
298 if (ret < 0) 298 if (ret < 0)
@@ -315,23 +315,23 @@ out_mutex:
315 mutex_unlock(&ctl_mutex); 315 mutex_unlock(&ctl_mutex);
316 kfree(rbdc); 316 kfree(rbdc);
317out_opt: 317out_opt:
318 if (opt) 318 if (ceph_opts)
319 ceph_destroy_options(opt); 319 ceph_destroy_options(ceph_opts);
320 return ERR_PTR(ret); 320 return ERR_PTR(ret);
321} 321}
322 322
323/* 323/*
324 * Find a ceph client with specific addr and configuration. 324 * Find a ceph client with specific addr and configuration.
325 */ 325 */
326static struct rbd_client *__rbd_client_find(struct ceph_options *opt) 326static struct rbd_client *__rbd_client_find(struct ceph_options *ceph_opts)
327{ 327{
328 struct rbd_client *client_node; 328 struct rbd_client *client_node;
329 329
330 if (opt->flags & CEPH_OPT_NOSHARE) 330 if (ceph_opts->flags & CEPH_OPT_NOSHARE)
331 return NULL; 331 return NULL;
332 332
333 list_for_each_entry(client_node, &rbd_client_list, node) 333 list_for_each_entry(client_node, &rbd_client_list, node)
334 if (ceph_compare_options(opt, client_node->client) == 0) 334 if (!ceph_compare_options(ceph_opts, client_node->client))
335 return client_node; 335 return client_node;
336 return NULL; 336 return NULL;
337} 337}
@@ -347,7 +347,7 @@ enum {
347 /* string args above */ 347 /* string args above */
348}; 348};
349 349
350static match_table_t rbdopt_tokens = { 350static match_table_t rbd_opts_tokens = {
351 {Opt_notify_timeout, "notify_timeout=%d"}, 351 {Opt_notify_timeout, "notify_timeout=%d"},
352 /* int args above */ 352 /* int args above */
353 /* string args above */ 353 /* string args above */
@@ -356,11 +356,11 @@ static match_table_t rbdopt_tokens = {
356 356
357static int parse_rbd_opts_token(char *c, void *private) 357static int parse_rbd_opts_token(char *c, void *private)
358{ 358{
359 struct rbd_options *rbdopt = private; 359 struct rbd_options *rbd_opts = private;
360 substring_t argstr[MAX_OPT_ARGS]; 360 substring_t argstr[MAX_OPT_ARGS];
361 int token, intval, ret; 361 int token, intval, ret;
362 362
363 token = match_token(c, rbdopt_tokens, argstr); 363 token = match_token(c, rbd_opts_tokens, argstr);
364 if (token < 0) 364 if (token < 0)
365 return -EINVAL; 365 return -EINVAL;
366 366
@@ -381,7 +381,7 @@ static int parse_rbd_opts_token(char *c, void *private)
381 381
382 switch (token) { 382 switch (token) {
383 case Opt_notify_timeout: 383 case Opt_notify_timeout:
384 rbdopt->notify_timeout = intval; 384 rbd_opts->notify_timeout = intval;
385 break; 385 break;
386 default: 386 default:
387 BUG_ON(token); 387 BUG_ON(token);
@@ -398,7 +398,7 @@ static struct rbd_client *rbd_get_client(const char *mon_addr,
398 char *options) 398 char *options)
399{ 399{
400 struct rbd_client *rbdc; 400 struct rbd_client *rbdc;
401 struct ceph_options *opt; 401 struct ceph_options *ceph_opts;
402 struct rbd_options *rbd_opts; 402 struct rbd_options *rbd_opts;
403 403
404 rbd_opts = kzalloc(sizeof(*rbd_opts), GFP_KERNEL); 404 rbd_opts = kzalloc(sizeof(*rbd_opts), GFP_KERNEL);
@@ -407,29 +407,29 @@ static struct rbd_client *rbd_get_client(const char *mon_addr,
407 407
408 rbd_opts->notify_timeout = RBD_NOTIFY_TIMEOUT_DEFAULT; 408 rbd_opts->notify_timeout = RBD_NOTIFY_TIMEOUT_DEFAULT;
409 409
410 opt = ceph_parse_options(options, mon_addr, 410 ceph_opts = ceph_parse_options(options, mon_addr,
411 mon_addr + mon_addr_len, 411 mon_addr + mon_addr_len,
412 parse_rbd_opts_token, rbd_opts); 412 parse_rbd_opts_token, rbd_opts);
413 if (IS_ERR(opt)) { 413 if (IS_ERR(ceph_opts)) {
414 kfree(rbd_opts); 414 kfree(rbd_opts);
415 return ERR_CAST(opt); 415 return ERR_CAST(ceph_opts);
416 } 416 }
417 417
418 spin_lock(&rbd_client_list_lock); 418 spin_lock(&rbd_client_list_lock);
419 rbdc = __rbd_client_find(opt); 419 rbdc = __rbd_client_find(ceph_opts);
420 if (rbdc) { 420 if (rbdc) {
421 /* using an existing client */ 421 /* using an existing client */
422 kref_get(&rbdc->kref); 422 kref_get(&rbdc->kref);
423 spin_unlock(&rbd_client_list_lock); 423 spin_unlock(&rbd_client_list_lock);
424 424
425 ceph_destroy_options(opt); 425 ceph_destroy_options(ceph_opts);
426 kfree(rbd_opts); 426 kfree(rbd_opts);
427 427
428 return rbdc; 428 return rbdc;
429 } 429 }
430 spin_unlock(&rbd_client_list_lock); 430 spin_unlock(&rbd_client_list_lock);
431 431
432 rbdc = rbd_client_create(opt, rbd_opts); 432 rbdc = rbd_client_create(ceph_opts, rbd_opts);
433 433
434 if (IS_ERR(rbdc)) 434 if (IS_ERR(rbdc))
435 kfree(rbd_opts); 435 kfree(rbd_opts);