From: Josh Durgin <josh.durgin@inktank.com>
To: Alex Elder <elder@inktank.com>
Cc: ceph-devel@vger.kernel.org
Subject: Re: [PATCH 15/16] rbd: option symbol renames
Date: Wed, 11 Jul 2012 14:07:02 -0700 [thread overview]
Message-ID: <4FFDEAF6.8040400@inktank.com> (raw)
In-Reply-To: <4FFD8799.80105@inktank.com>
On 07/11/2012 07:03 AM, Alex Elder wrote:
> 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>
> ---
> drivers/block/rbd.c | 40 ++++++++++++++++++++--------------------
> 1 files changed, 20 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
> index d29c864..c99ea08 100644
> --- a/drivers/block/rbd.c
> +++ b/drivers/block/rbd.c
> @@ -270,9 +270,9 @@ static const struct block_device_operations
> rbd_bd_ops = {
>
> /*
> * Initialize an rbd client instance.
> - * We own *opt.
> + * We own *ceph_opts.
> */
> -static struct rbd_client *rbd_client_create(struct ceph_options *opt,
> +static struct rbd_client *rbd_client_create(struct ceph_options *ceph_opts,
> struct rbd_options *rbd_opts)
> {
> struct rbd_client *rbdc;
> @@ -288,10 +288,10 @@ static struct rbd_client *rbd_client_create(struct
> ceph_options *opt,
>
> mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING);
>
> - rbdc->client = ceph_create_client(opt, rbdc, 0, 0);
> + rbdc->client = ceph_create_client(ceph_opts, rbdc, 0, 0);
> if (IS_ERR(rbdc->client))
> goto out_mutex;
> - opt = NULL; /* Now rbdc->client is responsible for opt */
> + ceph_opts = NULL; /* Now rbdc->client is responsible for ceph_opts */
>
> ret = ceph_open_session(rbdc->client);
> if (ret< 0)
> @@ -314,23 +314,23 @@ out_mutex:
> mutex_unlock(&ctl_mutex);
> kfree(rbdc);
> out_opt:
> - if (opt)
> - ceph_destroy_options(opt);
> + if (ceph_opts)
> + ceph_destroy_options(ceph_opts);
> return ERR_PTR(ret);
> }
>
> /*
> * Find a ceph client with specific addr and configuration.
> */
> -static struct rbd_client *__rbd_client_find(struct ceph_options *opt)
> +static struct rbd_client *__rbd_client_find(struct ceph_options *ceph_opts)
> {
> struct rbd_client *client_node;
>
> - if (opt->flags& CEPH_OPT_NOSHARE)
> + if (ceph_opts->flags& CEPH_OPT_NOSHARE)
> return NULL;
>
> list_for_each_entry(client_node,&rbd_client_list, node)
> - if (ceph_compare_options(opt, client_node->client) == 0)
> + if (!ceph_compare_options(ceph_opts, client_node->client))
> return client_node;
> return NULL;
> }
> @@ -346,7 +346,7 @@ enum {
> /* string args above */
> };
>
> -static match_table_t rbdopt_tokens = {
> +static match_table_t rbd_opts_tokens = {
> {Opt_notify_timeout, "notify_timeout=%d"},
> /* int args above */
> /* string args above */
> @@ -355,11 +355,11 @@ static match_table_t rbdopt_tokens = {
>
> static int parse_rbd_opts_token(char *c, void *private)
> {
> - struct rbd_options *rbdopt = private;
> + struct rbd_options *rbd_opts = private;
> substring_t argstr[MAX_OPT_ARGS];
> int token, intval, ret;
>
> - token = match_token(c, rbdopt_tokens, argstr);
> + token = match_token(c, rbd_opts_tokens, argstr);
> if (token< 0)
> return -EINVAL;
>
> @@ -380,7 +380,7 @@ static int parse_rbd_opts_token(char *c, void *private)
>
> switch (token) {
> case Opt_notify_timeout:
> - rbdopt->notify_timeout = intval;
> + rbd_opts->notify_timeout = intval;
> break;
> default:
> BUG_ON(token);
> @@ -397,7 +397,7 @@ static struct rbd_client *rbd_get_client(const char
> *mon_addr,
> char *options)
> {
> struct rbd_client *rbdc;
> - struct ceph_options *opt;
> + struct ceph_options *ceph_opts;
> struct rbd_options *rbd_opts;
>
> rbd_opts = kzalloc(sizeof(*rbd_opts), GFP_KERNEL);
> @@ -406,29 +406,29 @@ static struct rbd_client *rbd_get_client(const
> char *mon_addr,
>
> rbd_opts->notify_timeout = RBD_NOTIFY_TIMEOUT_DEFAULT;
>
> - opt = ceph_parse_options(options, mon_addr,
> + ceph_opts = ceph_parse_options(options, mon_addr,
> mon_addr + mon_addr_len,
> parse_rbd_opts_token, rbd_opts);
indentation
> - if (IS_ERR(opt)) {
> + if (IS_ERR(ceph_opts)) {
> kfree(rbd_opts);
> - return ERR_CAST(opt);
> + return ERR_CAST(ceph_opts);
> }
>
> spin_lock(&rbd_client_list_lock);
> - rbdc = __rbd_client_find(opt);
> + rbdc = __rbd_client_find(ceph_opts);
> if (rbdc) {
> /* using an existing client */
> kref_get(&rbdc->kref);
> spin_unlock(&rbd_client_list_lock);
>
> - ceph_destroy_options(opt);
> + ceph_destroy_options(ceph_opts);
> kfree(rbd_opts);
>
> return rbdc;
> }
> spin_unlock(&rbd_client_list_lock);
>
> - rbdc = rbd_client_create(opt, rbd_opts);
> + rbdc = rbd_client_create(ceph_opts, rbd_opts);
>
> if (IS_ERR(rbdc))
> kfree(rbd_opts);
next prev parent reply other threads:[~2012-07-11 21:07 UTC|newest]
Thread overview: 69+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-11 13:49 [PATCH 00/16] rbd: updates and enhancements Alex Elder
2012-07-11 14:00 ` [PATCH 01/16] libceph: fix off-by-one bug in ceph_encode_filepath() Alex Elder
2012-07-11 16:59 ` Yehuda Sadeh
2012-07-11 18:35 ` Josh Durgin
2012-07-11 14:00 ` [PATCH 02/16] rbd: drop a useless local variable Alex Elder
2012-07-11 16:58 ` Yehuda Sadeh Weinraub
2012-07-11 18:36 ` Josh Durgin
2012-07-11 14:00 ` [PATCH 03/16] libceph: define ceph_decode_string() Alex Elder
2012-07-11 17:13 ` Yehuda Sadeh
2012-07-11 18:43 ` Josh Durgin
2012-07-11 22:09 ` [PATCH v2 " Alex Elder
2012-07-12 17:13 ` Alex Elder
2012-07-11 14:01 ` [PATCH 04/16] libceph: define ceph_extract_encoded_string() Alex Elder
2012-07-11 17:20 ` Yehuda Sadeh
2012-07-11 17:45 ` Sage Weil
2012-07-11 19:14 ` Alex Elder
2012-07-11 19:26 ` Yehuda Sadeh
2012-07-11 22:10 ` [PATCH v2 " Alex Elder
2012-07-12 17:13 ` [PATCH v3 " Alex Elder
2012-07-12 18:20 ` Sage Weil
2012-07-12 19:48 ` Alex Elder
2012-07-12 22:47 ` Alex Elder
2012-07-12 22:47 ` [PATCH v4 " Alex Elder
2012-07-11 14:01 ` [PATCH 05/16] rbd: define dup_token() Alex Elder
2012-07-11 17:48 ` Yehuda Sadeh
2012-07-11 21:50 ` Alex Elder
2012-07-11 18:50 ` Josh Durgin
2012-07-11 14:01 ` [PATCH 06/16] rbd: rename rbd_dev->block_name Alex Elder
2012-07-11 17:55 ` Yehuda Sadeh
2012-07-11 19:02 ` Josh Durgin
2012-07-11 22:13 ` Alex Elder
2012-07-11 14:01 ` [PATCH 07/16] rbd: dynamically allocate object prefix Alex Elder
2012-07-11 19:12 ` Josh Durgin
2012-07-11 19:17 ` Alex Elder
2012-07-12 17:24 ` [PATCH v2 " Alex Elder
2012-07-12 17:42 ` Josh Durgin
2012-07-11 14:02 ` [PATCH 08/16] rbd: don't store pool name in struct rbd_dev Alex Elder
2012-07-11 19:36 ` Josh Durgin
2012-07-11 20:19 ` Sage Weil
2012-07-11 22:25 ` Alex Elder
2012-07-11 23:32 ` Josh Durgin
2012-07-12 2:59 ` Alex Elder
2012-07-12 4:19 ` Josh Durgin
2012-07-12 17:05 ` Alex Elder
2012-07-12 17:05 ` [PATCH] rbd: create pool_id device attribute Alex Elder
2012-07-12 17:16 ` Josh Durgin
2012-07-12 17:35 ` Alex Elder
2012-07-12 17:05 ` [PATCH] rbd: dynamically allocate pool name Alex Elder
2012-07-12 17:21 ` Josh Durgin
2012-07-11 14:02 ` [PATCH 09/16] rbd: dynamically allocate image header name Alex Elder
2012-07-11 20:41 ` Josh Durgin
2012-07-11 14:02 ` [PATCH 10/16] rbd: dynamically allocate image name Alex Elder
2012-07-11 20:49 ` Josh Durgin
2012-07-11 20:52 ` Josh Durgin
2012-07-12 11:12 ` Alex Elder
2012-07-11 14:02 ` [PATCH 11/16] rbd: dynamically allocate snapshot name Alex Elder
2012-07-11 20:53 ` Josh Durgin
2012-07-11 14:02 ` [PATCH 12/16] rbd: use rbd_dev consistently Alex Elder
2012-07-11 20:56 ` Josh Durgin
2012-07-11 14:02 ` [PATCH 13/16] rbd: rename some fields in struct rbd_dev Alex Elder
2012-07-11 21:01 ` Josh Durgin
2012-07-12 11:14 ` Alex Elder
2012-07-11 14:02 ` [PATCH 14/16] rbd: more symbol renames Alex Elder
2012-07-11 21:03 ` Josh Durgin
2012-07-12 11:15 ` Alex Elder
2012-07-11 14:03 ` [PATCH 15/16] rbd: option " Alex Elder
2012-07-11 21:07 ` Josh Durgin [this message]
2012-07-11 14:03 ` [PATCH 16/16] rbd: kill num_reply parameters Alex Elder
2012-07-11 21:07 ` Josh Durgin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FFDEAF6.8040400@inktank.com \
--to=josh.durgin@inktank.com \
--cc=ceph-devel@vger.kernel.org \
--cc=elder@inktank.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox