mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 9/9] nfs: parse nfsport and mount port from file system options
Date: Fri, 7 Feb 2014 11:06:26 +0100	[thread overview]
Message-ID: <20140207100626.GH17045@pengutronix.de> (raw)
In-Reply-To: <20140207084510.GI9671@ns203013.ovh.net>

Hello Jean-Christophe,

On Fri, Feb 07, 2014 at 09:45:10AM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 09:22 Fri 07 Feb     , Uwe Kleine-K??nig wrote:
> > On Fri, Feb 07, 2014 at 07:50:32AM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > > > +static void parseopt_hu(const char *options, const char *opt,
> > > > +		unsigned short *val)
> > > > +{
> > > > +	const char *start;
> > > > +	size_t optlen = strlen(opt);
> > > > +	ulong v;
> > > > +	char *endp;
> > > > +
> > > > +again:
> > > > +	start = strstr(options, opt);
> > > > +
> > > > +	if (!start)
> > > > +		return;
> > > > +
> > > > +	if (start > options && start[-1] != ',') {
> > > > +		options = start;
> > > > +		goto again;
> > > > +	}
> > > > +
> > > > +	if (start[optlen] != '=') {
> > > > +		options = start;
> > > > +		goto again;
> > > > +	}
> > > > +
> > > > +	v = simple_strtoul(start + optlen + 1, &endp, 0);
> > > > +	if (v > USHORT_MAX)
> > > > +		return;
> > > > +
> > > > +	if (*endp == ',' || *endp == '\0')
> > > > +		*val = v;
> > > > +}
> > > 
> > > this should be global
> > Yeah, do you have a suggestion where to put it? fs/parseopt.c?
> 
> why not
> 
> but IIRC the cmdline parser should be the same too
"the cmdline parser"? AFAIK there is no cmdline parser for the kernel
command line(?) in barebox. And if it were, the latter is ' '-separated
while the mount options are ','-separated. This could be abstracted, but
I think for now and until we need a linux kernel commandline parser it's
fine to hardcode ',' and let it live in fs/.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2014-02-07 10:06 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-06 16:40 [PATCH 0/9] nfs3 support Uwe Kleine-König
2014-02-06 16:40 ` [PATCH 1/9] net: net_read_uint32: assert that only 32 bit are read Uwe Kleine-König
2014-02-06 16:40 ` [PATCH 2/9] nfs: skip over stale rpc packets Uwe Kleine-König
2014-02-07  8:20   ` Uwe Kleine-König
2014-02-06 16:40 ` [PATCH 3/9] nfs: shorten and simplify rpc_add_credentials a bit Uwe Kleine-König
2014-02-06 16:40 ` [PATCH 4/9] nfs: simplify rpc_lookup_req Uwe Kleine-König
2014-02-06 16:40 ` [PATCH 5/9] nfs: drop an unneeded variable from nfs_do_open() Uwe Kleine-König
2014-02-06 16:40 ` [PATCH 6/9] net: new function net_read_uint64 Uwe Kleine-König
2014-02-07  8:17   ` Uwe Kleine-König
2014-02-06 16:40 ` [PATCH 7/9] mount: support filesystem options passed via -o Uwe Kleine-König
2014-02-06 16:40 ` [PATCH 8/9] nfs: switch to nfs3 Uwe Kleine-König
2014-02-07  6:48   ` Jean-Christophe PLAGNIOL-VILLARD
2014-02-07  8:52     ` Uwe Kleine-König
2014-02-07  9:50       ` Jean-Christophe PLAGNIOL-VILLARD
2014-02-07 10:23         ` Uwe Kleine-König
2014-02-06 16:40 ` [PATCH 9/9] nfs: parse nfsport and mount port from file system options Uwe Kleine-König
2014-02-07  6:50   ` Jean-Christophe PLAGNIOL-VILLARD
2014-02-07  8:22     ` Uwe Kleine-König
2014-02-07  8:45       ` Jean-Christophe PLAGNIOL-VILLARD
2014-02-07 10:06         ` Uwe Kleine-König [this message]

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=20140207100626.GH17045@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=plagnioj@jcrosoft.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