aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/ops_super.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2009-05-13 14:49:48 +0100
committerSteven Whitehouse <swhiteho@redhat.com>2009-05-13 14:49:48 +0100
commit48c2b613616235d7c97fda5982f50100a6c79166 (patch)
tree7c735f22b3908ec4bdebd27f5b51a8e4631485a6 /fs/gfs2/ops_super.c
parenta1c0643ff9f360a30644f6e3cd643ca2a5083aea (diff)
downloadlinux-48c2b613616235d7c97fda5982f50100a6c79166.tar.gz
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/ops_super.c')
-rw-r--r--fs/gfs2/ops_super.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/fs/gfs2/ops_super.c b/fs/gfs2/ops_super.c
index 458019569dcb43..0677a837856006 100644
--- a/fs/gfs2/ops_super.c
+++ b/fs/gfs2/ops_super.c
@@ -436,8 +436,12 @@ static int gfs2_remount_fs(struct super_block *sb, int *flags, char *data)
{
struct gfs2_sbd *sdp = sb->s_fs_info;
struct gfs2_args args = sdp->sd_args; /* Default to current settings */
+ struct gfs2_tune *gt = &sdp->sd_tune;
int error;
+ spin_lock(&gt->gt_spin);
+ args.ar_commit = gt->gt_log_flush_secs;
+ spin_unlock(&gt->gt_spin);
error = gfs2_mount_args(sdp, &args, data);
if (error)
return error;
@@ -473,6 +477,10 @@ static int gfs2_remount_fs(struct super_block *sb, int *flags, char *data)
sb->s_flags |= MS_POSIXACL;
else
sb->s_flags &= ~MS_POSIXACL;
+ spin_lock(&gt->gt_spin);
+ gt->gt_log_flush_secs = args.ar_commit;
+ spin_unlock(&gt->gt_spin);
+
return 0;
}
@@ -550,6 +558,7 @@ static int gfs2_show_options(struct seq_file *s, struct vfsmount *mnt)
{
struct gfs2_sbd *sdp = mnt->mnt_sb->s_fs_info;
struct gfs2_args *args = &sdp->sd_args;
+ int lfsecs;
if (is_ancestor(mnt->mnt_root, sdp->sd_master_dir))
seq_printf(s, ",meta");
@@ -610,7 +619,9 @@ static int gfs2_show_options(struct seq_file *s, struct vfsmount *mnt)
}
if (args->ar_discard)
seq_printf(s, ",discard");
-
+ lfsecs = sdp->sd_tune.gt_log_flush_secs;
+ if (lfsecs != 60)
+ seq_printf(s, ",commit=%d", lfsecs);
return 0;
}