summaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/super.c
diff options
context:
space:
mode:
authorMark Fasheh <mark.fasheh@oracle.com>2007-12-20 16:49:04 -0800
committerMark Fasheh <mark.fasheh@oracle.com>2008-01-25 15:05:43 -0800
commit53fc622b9e829c8e632e45ef8c14f054388759c1 (patch)
tree6b8585ab00312dd798d8087c452393bf6cc0d344 /fs/ocfs2/super.c
parentcf8e06f1a860d8680d6bb4ac8ec7d7724988e46f (diff)
downloadop-kernel-dev-53fc622b9e829c8e632e45ef8c14f054388759c1.zip
op-kernel-dev-53fc622b9e829c8e632e45ef8c14f054388759c1.tar.gz
[PATCH 2/2] ocfs2: cluster aware flock()
Hook up ocfs2_flock(), using the new flock lock type in dlmglue.c. A new mount option, "localflocks" is added so that users can revert to old functionality as need be. Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Diffstat (limited to 'fs/ocfs2/super.c')
-rw-r--r--fs/ocfs2/super.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index 1104f14..4a091f5 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -153,6 +153,7 @@ enum {
Opt_slot,
Opt_commit,
Opt_localalloc,
+ Opt_localflocks,
Opt_err,
};
@@ -170,6 +171,7 @@ static match_table_t tokens = {
{Opt_slot, "preferred_slot=%u"},
{Opt_commit, "commit=%u"},
{Opt_localalloc, "localalloc=%d"},
+ {Opt_localflocks, "localflocks"},
{Opt_err, NULL}
};
@@ -848,6 +850,20 @@ static int ocfs2_parse_options(struct super_block *sb,
if (option >= 0 && (option <= ocfs2_local_alloc_size(sb) * 8))
mopt->localalloc_opt = option;
break;
+ case Opt_localflocks:
+ /*
+ * Changing this during remount could race
+ * flock() requests, or "unbalance" existing
+ * ones (e.g., a lock is taken in one mode but
+ * dropped in the other). If users care enough
+ * to flip locking modes during remount, we
+ * could add a "local" flag to individual
+ * flock structures for proper tracking of
+ * state.
+ */
+ if (!is_remount)
+ mopt->mount_opt |= OCFS2_MOUNT_LOCALFLOCKS;
+ break;
default:
mlog(ML_ERROR,
"Unrecognized mount option \"%s\" "
@@ -903,6 +919,9 @@ static int ocfs2_show_options(struct seq_file *s, struct vfsmount *mnt)
if (osb->local_alloc_size != OCFS2_DEFAULT_LOCAL_ALLOC_SIZE)
seq_printf(s, ",localalloc=%d", osb->local_alloc_size);
+ if (opts & OCFS2_MOUNT_LOCALFLOCKS)
+ seq_printf(s, ",localflocks,");
+
return 0;
}
OpenPOWER on IntegriCloud