Commit 72637f57 authored by Dave Kleikamp's avatar Dave Kleikamp

[JFS] allow resize option with no parameter

The resize option is valid both with and without a parameter.  When cleaning
up the parsing code to use match_token(), the ability to specify resize
without a parameter was lost.
parent 683fb580
/* /*
* Copyright (C) International Business Machines Corp., 2000-2003 * Copyright (C) International Business Machines Corp., 2000-2004
* Portions Copyright (C) Christoph Hellwig, 2001-2002 * Portions Copyright (C) Christoph Hellwig, 2001-2002
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -203,7 +203,7 @@ static void jfs_put_super(struct super_block *sb) ...@@ -203,7 +203,7 @@ static void jfs_put_super(struct super_block *sb)
enum { enum {
Opt_integrity, Opt_nointegrity, Opt_iocharset, Opt_resize, Opt_integrity, Opt_nointegrity, Opt_iocharset, Opt_resize,
Opt_errors, Opt_ignore, Opt_err, Opt_resize_nosize, Opt_errors, Opt_ignore, Opt_err,
}; };
static match_table_t tokens = { static match_table_t tokens = {
...@@ -211,6 +211,7 @@ static match_table_t tokens = { ...@@ -211,6 +211,7 @@ static match_table_t tokens = {
{Opt_nointegrity, "nointegrity"}, {Opt_nointegrity, "nointegrity"},
{Opt_iocharset, "iocharset=%s"}, {Opt_iocharset, "iocharset=%s"},
{Opt_resize, "resize=%u"}, {Opt_resize, "resize=%u"},
{Opt_resize_nosize, "resize"},
{Opt_errors, "errors=%s"}, {Opt_errors, "errors=%s"},
{Opt_ignore, "noquota"}, {Opt_ignore, "noquota"},
{Opt_ignore, "quota"}, {Opt_ignore, "quota"},
...@@ -261,14 +262,16 @@ static int parse_options(char *options, struct super_block *sb, s64 *newLVSize, ...@@ -261,14 +262,16 @@ static int parse_options(char *options, struct super_block *sb, s64 *newLVSize,
case Opt_resize: case Opt_resize:
{ {
char *resize = args[0].from; char *resize = args[0].from;
if (!resize || !*resize) { *newLVSize = simple_strtoull(resize, &resize, 0);
*newLVSize = sb->s_bdev->bd_inode->i_size >> break;
sb->s_blocksize_bits; }
if (*newLVSize == 0) case Opt_resize_nosize:
printk(KERN_ERR {
"JFS: Cannot determine volume size\n"); *newLVSize = sb->s_bdev->bd_inode->i_size >>
} else sb->s_blocksize_bits;
*newLVSize = simple_strtoull(resize, &resize, 0); if (*newLVSize == 0)
printk(KERN_ERR
"JFS: Cannot determine volume size\n");
break; break;
} }
case Opt_errors: case Opt_errors:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment