25-akpm/fs/befs/linuxvfs.c | 71 +++++++++++++++++++++------------------------ 1 files changed, 34 insertions(+), 37 deletions(-) diff -puN fs/befs/linuxvfs.c~befs-use-parser-update fs/befs/linuxvfs.c --- 25/fs/befs/linuxvfs.c~befs-use-parser-update Mon Sep 22 11:42:41 2003 +++ 25-akpm/fs/befs/linuxvfs.c Mon Sep 22 11:44:42 2003 @@ -688,6 +688,7 @@ parse_options(char *options, befs_mount_ { char *p; substring_t args[MAX_OPT_ARGS]; + int option; /* Initialize options */ opts->uid = 0; @@ -707,48 +708,44 @@ parse_options(char *options, befs_mount_ token = match_token(p, befs_tokens, args); switch (token) { - case Opt_uid: - { - int uid = match_int(&args[0]); - if (uid < 0) { - printk(KERN_ERR "BeFS: Invalid uid %d, " - "using default\n", uid); - break; - } - opts->uid = uid; - opts->use_uid = 1; - break; - } - case Opt_gid: - { - int gid = match_int(&args[0]); - if (gid < 0) { - printk(KERN_ERR "BeFS: Invalid gid %d, " - "using default\n", gid); - break; - } - opts->gid = gid; - opts->use_gid = 1; + case Opt_uid: + if (match_int(&args[0], &option)) + return 0; + if (option < 0) { + printk(KERN_ERR "BeFS: Invalid uid %d, " + "using default\n", option); break; } - case Opt_charset: - { - kfree(opts->iocharset); - opts->iocharset = match_strdup(&args[0]); - if (!opts->iocharset) { - printk(KERN_ERR "BeFS: allocation failure for " - "iocharset string\n"); - return 0; - } + opts->uid = option; + opts->use_uid = 1; + break; + case Opt_gid: + if (match_int(&args[0], &option)) + return 0; + if (option < 0) { + printk(KERN_ERR "BeFS: Invalid gid %d, " + "using default\n", option); break; } - case Opt_debug: - opts->debug = 1; - break; - default: - printk(KERN_ERR "BeFS: Unrecognized mount option \"%s\" " - "or missing value\n", p); + opts->gid = option; + opts->use_gid = 1; + break; + case Opt_charset: + kfree(opts->iocharset); + opts->iocharset = match_strdup(&args[0]); + if (!opts->iocharset) { + printk(KERN_ERR "BeFS: allocation failure for " + "iocharset string\n"); return 0; + } + break; + case Opt_debug: + opts->debug = 1; + break; + default: + printk(KERN_ERR "BeFS: Unrecognized mount option \"%s\" " + "or missing value\n", p); + return 0; } } return 1; _