aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/super.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2009-10-30 03:03:27 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2009-12-03 06:55:54 -0500
commitf25934c5f88655a8d5c3c40a540daed1f0e6dedc (patch)
treea21e1ab167314292ffe2e3b319c8d5abf5faccd7 /fs/gfs2/super.c
parentc14f5735e724cb5338ca8298d42b1658008a10d7 (diff)
GFS2: add barrier/nobarrier mount options
Currently gfs2 issues barrier unconditionally. There are various reasons to disable them, be that just for testing or for stupid devices flushing large battert backed caches. Add a nobarrier option that matches xfs and btrfs for this. Also add a symmetric barrier option to turn it back on at remount time. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/super.c')
-rw-r--r--fs/gfs2/super.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index b1dcfab36465..5e4b31441a9e 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -73,6 +73,8 @@ enum {
73 Opt_statfs_quantum, 73 Opt_statfs_quantum,
74 Opt_statfs_percent, 74 Opt_statfs_percent,
75 Opt_quota_quantum, 75 Opt_quota_quantum,
76 Opt_barrier,
77 Opt_nobarrier,
76 Opt_error, 78 Opt_error,
77}; 79};
78 80
@@ -107,6 +109,8 @@ static const match_table_t tokens = {
107 {Opt_statfs_quantum, "statfs_quantum=%d"}, 109 {Opt_statfs_quantum, "statfs_quantum=%d"},
108 {Opt_statfs_percent, "statfs_percent=%d"}, 110 {Opt_statfs_percent, "statfs_percent=%d"},
109 {Opt_quota_quantum, "quota_quantum=%d"}, 111 {Opt_quota_quantum, "quota_quantum=%d"},
112 {Opt_barrier, "barrier"},
113 {Opt_nobarrier, "nobarrier"},
110 {Opt_error, NULL} 114 {Opt_error, NULL}
111}; 115};
112 116
@@ -253,6 +257,12 @@ int gfs2_mount_args(struct gfs2_args *args, char *options)
253 } 257 }
254 args->ar_errors = GFS2_ERRORS_PANIC; 258 args->ar_errors = GFS2_ERRORS_PANIC;
255 break; 259 break;
260 case Opt_barrier:
261 args->ar_nobarrier = 0;
262 break;
263 case Opt_nobarrier:
264 args->ar_nobarrier = 1;
265 break;
256 case Opt_error: 266 case Opt_error:
257 default: 267 default:
258 printk(KERN_WARNING "GFS2: invalid mount option: %s\n", o); 268 printk(KERN_WARNING "GFS2: invalid mount option: %s\n", o);
@@ -1143,6 +1153,10 @@ static int gfs2_remount_fs(struct super_block *sb, int *flags, char *data)
1143 sb->s_flags |= MS_POSIXACL; 1153 sb->s_flags |= MS_POSIXACL;
1144 else 1154 else
1145 sb->s_flags &= ~MS_POSIXACL; 1155 sb->s_flags &= ~MS_POSIXACL;
1156 if (sdp->sd_args.ar_nobarrier)
1157 set_bit(SDF_NOBARRIERS, &sdp->sd_flags);
1158 else
1159 clear_bit(SDF_NOBARRIERS, &sdp->sd_flags);
1146 spin_lock(&gt->gt_spin); 1160 spin_lock(&gt->gt_spin);
1147 gt->gt_log_flush_secs = args.ar_commit; 1161 gt->gt_log_flush_secs = args.ar_commit;
1148 gt->gt_quota_quantum = args.ar_quota_quantum; 1162 gt->gt_quota_quantum = args.ar_quota_quantum;