diff options
author | Christoph Hellwig <hch@lst.de> | 2009-10-30 03:03:27 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2009-12-03 06:55:54 -0500 |
commit | f25934c5f88655a8d5c3c40a540daed1f0e6dedc (patch) | |
tree | a21e1ab167314292ffe2e3b319c8d5abf5faccd7 | |
parent | c14f5735e724cb5338ca8298d42b1658008a10d7 (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>
-rw-r--r-- | fs/gfs2/incore.h | 1 | ||||
-rw-r--r-- | fs/gfs2/ops_fstype.c | 2 | ||||
-rw-r--r-- | fs/gfs2/super.c | 14 |
3 files changed, 17 insertions, 0 deletions
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h index c239b0f969c8..4792200978c8 100644 --- a/fs/gfs2/incore.h +++ b/fs/gfs2/incore.h | |||
@@ -429,6 +429,7 @@ struct gfs2_args { | |||
429 | unsigned int ar_meta:1; /* mount metafs */ | 429 | unsigned int ar_meta:1; /* mount metafs */ |
430 | unsigned int ar_discard:1; /* discard requests */ | 430 | unsigned int ar_discard:1; /* discard requests */ |
431 | unsigned int ar_errors:2; /* errors=withdraw | panic */ | 431 | unsigned int ar_errors:2; /* errors=withdraw | panic */ |
432 | unsigned int ar_nobarrier:1; /* do not send barriers */ | ||
432 | int ar_commit; /* Commit interval */ | 433 | int ar_commit; /* Commit interval */ |
433 | int ar_statfs_quantum; /* The fast statfs interval */ | 434 | int ar_statfs_quantum; /* The fast statfs interval */ |
434 | int ar_quota_quantum; /* The quota interval */ | 435 | int ar_quota_quantum; /* The quota interval */ |
diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index 9744ee920473..edfee24f3636 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c | |||
@@ -1131,6 +1131,8 @@ static int fill_super(struct super_block *sb, struct gfs2_args *args, int silent | |||
1131 | } | 1131 | } |
1132 | if (sdp->sd_args.ar_posix_acl) | 1132 | if (sdp->sd_args.ar_posix_acl) |
1133 | sb->s_flags |= MS_POSIXACL; | 1133 | sb->s_flags |= MS_POSIXACL; |
1134 | if (sdp->sd_args.ar_nobarrier) | ||
1135 | set_bit(SDF_NOBARRIERS, &sdp->sd_flags); | ||
1134 | 1136 | ||
1135 | sb->s_magic = GFS2_MAGIC; | 1137 | sb->s_magic = GFS2_MAGIC; |
1136 | sb->s_op = &gfs2_super_ops; | 1138 | sb->s_op = &gfs2_super_ops; |
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_spin); | 1160 | spin_lock(>->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; |