diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2009-05-13 17:49:48 +0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2009-05-13 17:49:48 +0400 |
commit | 48c2b613616235d7c97fda5982f50100a6c79166 (patch) | |
tree | 7c735f22b3908ec4bdebd27f5b51a8e4631485a6 /fs/gfs2/mount.c | |
parent | a1c0643ff9f360a30644f6e3cd643ca2a5083aea (diff) | |
download | linux-48c2b613616235d7c97fda5982f50100a6c79166.tar.xz |
GFS2: Add commit= mount option
It has always been possible to adjust the gfs2 log commit
interval, but only from the sysfs interface. This adds a
mount option, commit=<nn>, which will be familar to ext3
users.
The sysfs interface continues to be available as well, although
this might be removed in the future.
Also this patch cleans up some duplicated structures in the GFS2
sysfs code.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/mount.c')
-rw-r--r-- | fs/gfs2/mount.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/gfs2/mount.c b/fs/gfs2/mount.c index f7e8527a21e0..947af151fa24 100644 --- a/fs/gfs2/mount.c +++ b/fs/gfs2/mount.c @@ -45,6 +45,7 @@ enum { Opt_meta, Opt_discard, Opt_nodiscard, + Opt_commit, Opt_err, }; @@ -73,6 +74,7 @@ static const match_table_t tokens = { {Opt_meta, "meta"}, {Opt_discard, "discard"}, {Opt_nodiscard, "nodiscard"}, + {Opt_commit, "commit=%d"}, {Opt_err, NULL} }; @@ -89,6 +91,7 @@ int gfs2_mount_args(struct gfs2_sbd *sdp, struct gfs2_args *args, char *options) char *o; int token; substring_t tmp[MAX_OPT_ARGS]; + int rv; /* Split the options into tokens with the "," character and process them */ @@ -173,6 +176,13 @@ int gfs2_mount_args(struct gfs2_sbd *sdp, struct gfs2_args *args, char *options) case Opt_nodiscard: args->ar_discard = 0; break; + case Opt_commit: + rv = match_int(&tmp[0], &args->ar_commit); + if (rv || args->ar_commit <= 0) { + fs_info(sdp, "commit mount option requires a positive numeric argument\n"); + return rv ? rv : -EINVAL; + } + break; case Opt_err: default: fs_info(sdp, "invalid mount option: %s\n", o); |