lkml.org 
[lkml]   [2004]   [Apr]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 2.6.6-rc2-mm1] autofs parser simplified
From
Date
Andrew,

Here's a patch to avoid int parse redundancy in autofs.
Could you apply ?

Regards,
Fabian
diff -Naur orig/fs/autofs/inode.c edited/fs/autofs/inode.c
--- orig/fs/autofs/inode.c 2004-04-04 05:37:38.000000000 +0200
+++ edited/fs/autofs/inode.c 2004-04-21 20:29:26.000000000 +0200
@@ -58,7 +58,7 @@
{Opt_err, NULL}
};

-static int parse_options(char *options, int *pipefd, uid_t *uid, gid_t *gid, pid_t *pgrp, int *minproto, int *maxproto)
+static int parse_options(char *options, int *pipefd, uid_t *uid, gid_t *gid, pid_t *pgrp, int *minproto, int *maxproto)
{
char *p;
substring_t args[MAX_OPT_ARGS];
@@ -79,37 +79,28 @@
int token;
if (!*p)
continue;
-
token = match_token(p, autofs_tokens, args);
+
+ /*We only have %u tokens so...*/
+ if (match_int(&args[0], &option))
+ return 1;
switch (token) {
case Opt_fd:
- if (match_int(&args[0], &option))
- return 1;
*pipefd = option;
break;
case Opt_uid:
- if (match_int(&args[0], &option))
- return 1;
*uid = option;
break;
case Opt_gid:
- if (match_int(&args[0], &option))
- return 1;
*gid = option;
break;
case Opt_pgrp:
- if (match_int(&args[0], &option))
- return 1;
*pgrp = option;
break;
case Opt_minproto:
- if (match_int(&args[0], &option))
- return 1;
*minproto = option;
break;
case Opt_maxproto:
- if (match_int(&args[0], &option))
- return 1;
*maxproto = option;
break;
default:
\
 
 \ /
  Last update: 2005-03-22 14:02    [W:0.213 / U:0.516 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site