diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2011-08-30 02:49:34 -0400 |
---|---|---|
committer | Eric Van Hensbergen <ericvh@gmail.com> | 2011-10-24 12:13:12 -0400 |
commit | 4d5077f1b2aa502a0ca98b450d1b16fbccfe9c63 (patch) | |
tree | dab8859206b0e198a2d0862a1228d8342073e659 /net/9p | |
parent | 5635fd0ccf4ce90a9ecf8fa48f5f031f5f73e6f5 (diff) |
fs/9p: Cleanup option parsing in 9p
Instead of saying all integer argument option should be listed in the beginning
move integer parsing to each option type.
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'net/9p')
-rw-r--r-- | net/9p/client.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/net/9p/client.c b/net/9p/client.c index 9eadadb0a698..0edee4de608a 100644 --- a/net/9p/client.c +++ b/net/9p/client.c | |||
@@ -123,21 +123,19 @@ static int parse_opts(char *opts, struct p9_client *clnt) | |||
123 | options = tmp_options; | 123 | options = tmp_options; |
124 | 124 | ||
125 | while ((p = strsep(&options, ",")) != NULL) { | 125 | while ((p = strsep(&options, ",")) != NULL) { |
126 | int token; | 126 | int token, r; |
127 | if (!*p) | 127 | if (!*p) |
128 | continue; | 128 | continue; |
129 | token = match_token(p, tokens, args); | 129 | token = match_token(p, tokens, args); |
130 | if (token < Opt_trans) { | 130 | switch (token) { |
131 | int r = match_int(&args[0], &option); | 131 | case Opt_msize: |
132 | r = match_int(&args[0], &option); | ||
132 | if (r < 0) { | 133 | if (r < 0) { |
133 | P9_DPRINTK(P9_DEBUG_ERROR, | 134 | P9_DPRINTK(P9_DEBUG_ERROR, |
134 | "integer field, but no integer?\n"); | 135 | "integer field, but no integer?\n"); |
135 | ret = r; | 136 | ret = r; |
136 | continue; | 137 | continue; |
137 | } | 138 | } |
138 | } | ||
139 | switch (token) { | ||
140 | case Opt_msize: | ||
141 | clnt->msize = option; | 139 | clnt->msize = option; |
142 | break; | 140 | break; |
143 | case Opt_trans: | 141 | case Opt_trans: |