aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/super.c
diff options
context:
space:
mode:
authorTristan Ye <tristan.ye@oracle.com>2010-10-11 04:46:39 -0400
committerJoel Becker <joel.becker@oracle.com>2010-10-11 17:14:55 -0400
commit7bdb0d18bfd381cc5491eb95973ec5604b356c7e (patch)
tree1abe07df935a336eeac5c7705dc9b59341b47b0a /fs/ocfs2/super.c
parent75d9bbc73804285020aa4d99bd2a9600edea8945 (diff)
ocfs2: Add a mount option "coherency=*" to handle cluster coherency for O_DIRECT writes.
Currently, the default behavior of O_DIRECT writes was allowing concurrent writing among nodes to the same file, with no cluster coherency guaranteed (no EX lock held). This can leave stale data in the cache for buffered reads on other nodes. The new mount option introduce a chance to choose two different behaviors for O_DIRECT writes: * coherency=full, as the default value, will disallow concurrent O_DIRECT writes by taking EX locks. * coherency=buffered, allow concurrent O_DIRECT writes without EX lock among nodes, which gains high performance at risk of getting stale data on other nodes. Signed-off-by: Tristan Ye <tristan.ye@oracle.com> Signed-off-by: Joel Becker <joel.becker@oracle.com>
Diffstat (limited to 'fs/ocfs2/super.c')
-rw-r--r--fs/ocfs2/super.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index b578644b6637..9122d59f8127 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -177,6 +177,8 @@ enum {
177 Opt_noacl, 177 Opt_noacl,
178 Opt_usrquota, 178 Opt_usrquota,
179 Opt_grpquota, 179 Opt_grpquota,
180 Opt_coherency_buffered,
181 Opt_coherency_full,
180 Opt_resv_level, 182 Opt_resv_level,
181 Opt_dir_resv_level, 183 Opt_dir_resv_level,
182 Opt_err, 184 Opt_err,
@@ -205,6 +207,8 @@ static const match_table_t tokens = {
205 {Opt_noacl, "noacl"}, 207 {Opt_noacl, "noacl"},
206 {Opt_usrquota, "usrquota"}, 208 {Opt_usrquota, "usrquota"},
207 {Opt_grpquota, "grpquota"}, 209 {Opt_grpquota, "grpquota"},
210 {Opt_coherency_buffered, "coherency=buffered"},
211 {Opt_coherency_full, "coherency=full"},
208 {Opt_resv_level, "resv_level=%u"}, 212 {Opt_resv_level, "resv_level=%u"},
209 {Opt_dir_resv_level, "dir_resv_level=%u"}, 213 {Opt_dir_resv_level, "dir_resv_level=%u"},
210 {Opt_err, NULL} 214 {Opt_err, NULL}
@@ -1452,6 +1456,12 @@ static int ocfs2_parse_options(struct super_block *sb,
1452 case Opt_grpquota: 1456 case Opt_grpquota:
1453 mopt->mount_opt |= OCFS2_MOUNT_GRPQUOTA; 1457 mopt->mount_opt |= OCFS2_MOUNT_GRPQUOTA;
1454 break; 1458 break;
1459 case Opt_coherency_buffered:
1460 mopt->mount_opt |= OCFS2_MOUNT_COHERENCY_BUFFERED;
1461 break;
1462 case Opt_coherency_full:
1463 mopt->mount_opt &= ~OCFS2_MOUNT_COHERENCY_BUFFERED;
1464 break;
1455 case Opt_acl: 1465 case Opt_acl:
1456 mopt->mount_opt |= OCFS2_MOUNT_POSIX_ACL; 1466 mopt->mount_opt |= OCFS2_MOUNT_POSIX_ACL;
1457 mopt->mount_opt &= ~OCFS2_MOUNT_NO_POSIX_ACL; 1467 mopt->mount_opt &= ~OCFS2_MOUNT_NO_POSIX_ACL;
@@ -1550,6 +1560,11 @@ static int ocfs2_show_options(struct seq_file *s, struct vfsmount *mnt)
1550 if (opts & OCFS2_MOUNT_GRPQUOTA) 1560 if (opts & OCFS2_MOUNT_GRPQUOTA)
1551 seq_printf(s, ",grpquota"); 1561 seq_printf(s, ",grpquota");
1552 1562
1563 if (opts & OCFS2_MOUNT_COHERENCY_BUFFERED)
1564 seq_printf(s, ",coherency=buffered");
1565 else
1566 seq_printf(s, ",coherency=full");
1567
1553 if (opts & OCFS2_MOUNT_NOUSERXATTR) 1568 if (opts & OCFS2_MOUNT_NOUSERXATTR)
1554 seq_printf(s, ",nouser_xattr"); 1569 seq_printf(s, ",nouser_xattr");
1555 else 1570 else