All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Elder <elder@ieee.org>
To: Ilya Dryomov <idryomov@gmail.com>, ceph-devel@vger.kernel.org
Subject: Re: [PATCH 1/3] rbd: terminate rbd_opts_tokens with Opt_err
Date: Thu, 25 Jun 2015 09:22:46 -0500	[thread overview]
Message-ID: <558C0EB6.20708@ieee.org> (raw)
In-Reply-To: <1435223480-35238-2-git-send-email-idryomov@gmail.com>

On 06/25/2015 04:11 AM, Ilya Dryomov wrote:
> Also nuke useless Opt_last_bool and don't break lines unnecessarily.
>
> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>

Good idea.

Reviewed-by: Alex Elder <elder@linaro.org>

> ---
>   drivers/block/rbd.c | 24 ++++++++----------------
>   1 file changed, 8 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
> index bc88fbcb9715..4de8c9167c4b 100644
> --- a/drivers/block/rbd.c
> +++ b/drivers/block/rbd.c
> @@ -724,7 +724,7 @@ static struct rbd_client *rbd_client_find(struct ceph_options *ceph_opts)
>   }
>
>   /*
> - * mount options
> + * (Per device) rbd map options
>    */
>   enum {
>   	Opt_last_int,
> @@ -733,8 +733,7 @@ enum {
>   	/* string args above */
>   	Opt_read_only,
>   	Opt_read_write,
> -	/* Boolean args above */
> -	Opt_last_bool,
> +	Opt_err
>   };
>
>   static match_table_t rbd_opts_tokens = {
> @@ -744,8 +743,7 @@ static match_table_t rbd_opts_tokens = {
>   	{Opt_read_only, "ro"},		/* Alternate spelling */
>   	{Opt_read_write, "read_write"},
>   	{Opt_read_write, "rw"},		/* Alternate spelling */
> -	/* Boolean args above */
> -	{-1, NULL}
> +	{Opt_err, NULL}
>   };
>
>   struct rbd_options {
> @@ -761,22 +759,15 @@ static int parse_rbd_opts_token(char *c, void *private)
>   	int token, intval, ret;
>
>   	token = match_token(c, rbd_opts_tokens, argstr);
> -	if (token < 0)
> -		return -EINVAL;
> -
>   	if (token < Opt_last_int) {
>   		ret = match_int(&argstr[0], &intval);
>   		if (ret < 0) {
> -			pr_err("bad mount option arg (not int) "
> -			       "at '%s'\n", c);
> +			pr_err("bad mount option arg (not int) at '%s'\n", c);
>   			return ret;
>   		}
>   		dout("got int token %d val %d\n", token, intval);
>   	} else if (token > Opt_last_int && token < Opt_last_string) {
> -		dout("got string token %d val %s\n", token,
> -		     argstr[0].from);
> -	} else if (token > Opt_last_string && token < Opt_last_bool) {
> -		dout("got Boolean token %d\n", token);
> +		dout("got string token %d val %s\n", token, argstr[0].from);
>   	} else {
>   		dout("got token %d\n", token);
>   	}
> @@ -789,9 +780,10 @@ static int parse_rbd_opts_token(char *c, void *private)
>   		rbd_opts->read_only = false;
>   		break;
>   	default:
> -		rbd_assert(false);
> -		break;
> +		/* libceph prints "bad option" msg */
> +		return -EINVAL;
>   	}
> +
>   	return 0;
>   }
>
>


  reply	other threads:[~2015-06-25 14:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-25  9:11 [PATCH 0/3] rbd: queue_depth map option Ilya Dryomov
2015-06-25  9:11 ` [PATCH 1/3] rbd: terminate rbd_opts_tokens with Opt_err Ilya Dryomov
2015-06-25 14:22   ` Alex Elder [this message]
2015-06-25  9:11 ` [PATCH 2/3] rbd: store rbd_options in rbd_device Ilya Dryomov
2015-06-25 14:23   ` Alex Elder
2015-06-25  9:11 ` [PATCH 3/3] rbd: queue_depth map option Ilya Dryomov
2015-06-25 14:24   ` Alex Elder
2015-06-25 14:31     ` Ilya Dryomov

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=558C0EB6.20708@ieee.org \
    --to=elder@ieee.org \
    --cc=ceph-devel@vger.kernel.org \
    --cc=idryomov@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.