From 6f5867a89de55d0e71aaa5dd12bd39171b9054e5 Mon Sep 17 00:00:00 2001 From: Paolo 'Blaisorblade' Giarrusso Date: Sun, 1 May 2005 08:59:05 -0700 Subject: [PATCH] --- yaml --- r: 719 b: refs/heads/master c: 9a3bb3017383fbb6fe56431d17f60bd0d50f0717 h: refs/heads/master i: 717: 93d87eb6464031b3aa6d11c50752950a259c5925 715: 0e71d9c6fcbbaa06338c6e44868d0bbab319cac5 711: 7ba6fc0cabd447f20b8a7df17be18e9981f4920a 703: ba53a08f499bd8ef777207c4f2fa1b5b563ff648 v: v3 --- [refs] | 2 +- trunk/fs/reiserfs/super.c | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 0c66f76cda82..6e13ebfb7764 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a83f1fe27f7252a2b73b4f22066e92bf99bd595b +refs/heads/master: 9a3bb3017383fbb6fe56431d17f60bd0d50f0717 diff --git a/trunk/fs/reiserfs/super.c b/trunk/fs/reiserfs/super.c index bcdf2438d152..bc5e8893b5d5 100644 --- a/trunk/fs/reiserfs/super.c +++ b/trunk/fs/reiserfs/super.c @@ -889,12 +889,18 @@ static int reiserfs_parse_options (struct super_block * s, char * options, /* st char * p; p = NULL; - /* "resize=NNN" */ - *blocks = simple_strtoul (arg, &p, 0); - if (*p != '\0') { - /* NNN does not look like a number */ - reiserfs_warning (s, "reiserfs_parse_options: bad value %s", arg); - return 0; + /* "resize=NNN" or "resize=auto" */ + + if (!strcmp(arg, "auto")) { + /* From JFS code, to auto-get the size.*/ + *blocks = s->s_bdev->bd_inode->i_size >> s->s_blocksize_bits; + } else { + *blocks = simple_strtoul (arg, &p, 0); + if (*p != '\0') { + /* NNN does not look like a number */ + reiserfs_warning (s, "reiserfs_parse_options: bad value %s", arg); + return 0; + } } } @@ -903,7 +909,8 @@ static int reiserfs_parse_options (struct super_block * s, char * options, /* st unsigned long val = simple_strtoul (arg, &p, 0); /* commit=NNN (time in seconds) */ if ( *p != '\0' || val >= (unsigned int)-1) { - reiserfs_warning (s, "reiserfs_parse_options: bad value %s", arg); return 0; + reiserfs_warning (s, "reiserfs_parse_options: bad value %s", arg); + return 0; } *commit_max_age = (unsigned int)val; }