]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/ocfs2/dlmglue.c
smc91x: fix build breakage from the SMC_GET_MAC_ADDR API upgrade
[linux-2.6-omap-h63xx.git] / fs / ocfs2 / dlmglue.c
index 3867244fb144a4c639f0e1ed2fdd41dcffc7798d..1f1873bf41fb3f5f50f61582b38ecf0c5cb2e0fe 100644 (file)
@@ -43,6 +43,7 @@
 #include <cluster/masklog.h>
 
 #include "ocfs2.h"
+#include "ocfs2_lockingver.h"
 
 #include "alloc.h"
 #include "dcache.h"
@@ -258,6 +259,31 @@ static struct ocfs2_lock_res_ops ocfs2_flock_lops = {
        .flags          = 0,
 };
 
+/*
+ * This is the filesystem locking protocol version.
+ *
+ * Whenever the filesystem does new things with locks (adds or removes a
+ * lock, orders them differently, does different things underneath a lock),
+ * the version must be changed.  The protocol is negotiated when joining
+ * the dlm domain.  A node may join the domain if its major version is
+ * identical to all other nodes and its minor version is greater than
+ * or equal to all other nodes.  When its minor version is greater than
+ * the other nodes, it will run at the minor version specified by the
+ * other nodes.
+ *
+ * If a locking change is made that will not be compatible with older
+ * versions, the major number must be increased and the minor version set
+ * to zero.  If a change merely adds a behavior that can be disabled when
+ * speaking to older versions, the minor version must be increased.  If a
+ * change adds a fully backwards compatible change (eg, LVB changes that
+ * are just ignored by older versions), the version does not need to be
+ * updated.
+ */
+const struct dlm_protocol_version ocfs2_locking_protocol = {
+       .pv_major = OCFS2_LOCKING_PROTOCOL_MAJOR,
+       .pv_minor = OCFS2_LOCKING_PROTOCOL_MINOR,
+};
+
 static inline int ocfs2_is_inode_lock(struct ocfs2_lock_res *lockres)
 {
        return lockres->l_type == OCFS2_LOCK_TYPE_META ||
@@ -2383,7 +2409,7 @@ static int ocfs2_dlm_seq_show(struct seq_file *m, void *v)
        return 0;
 }
 
-static struct seq_operations ocfs2_dlm_seq_ops = {
+static const struct seq_operations ocfs2_dlm_seq_ops = {
        .start =        ocfs2_dlm_seq_start,
        .stop =         ocfs2_dlm_seq_stop,
        .next =         ocfs2_dlm_seq_next,
@@ -2506,7 +2532,8 @@ int ocfs2_dlm_init(struct ocfs2_super *osb)
        dlm_key = crc32_le(0, osb->uuid_str, strlen(osb->uuid_str));
 
        /* for now, uuid == domain */
-       dlm = dlm_register_domain(osb->uuid_str, dlm_key);
+       dlm = dlm_register_domain(osb->uuid_str, dlm_key,
+                                 &osb->osb_locking_proto);
        if (IS_ERR(dlm)) {
                status = PTR_ERR(dlm);
                mlog_errno(status);
@@ -3015,7 +3042,7 @@ static int ocfs2_data_convert_worker(struct ocfs2_lock_res *lockres,
                inode = ocfs2_lock_res_inode(lockres);
        mapping = inode->i_mapping;
 
-       if (S_ISREG(inode->i_mode))
+       if (!S_ISREG(inode->i_mode))
                goto out;
 
        /*
@@ -3192,8 +3219,8 @@ static int ocfs2_dentry_convert_worker(struct ocfs2_lock_res *lockres,
        return UNBLOCK_CONTINUE_POST;
 }
 
-void ocfs2_process_blocked_lock(struct ocfs2_super *osb,
-                               struct ocfs2_lock_res *lockres)
+static void ocfs2_process_blocked_lock(struct ocfs2_super *osb,
+                                      struct ocfs2_lock_res *lockres)
 {
        int status;
        struct ocfs2_unblock_ctl ctl = {0, 0,};
@@ -3329,7 +3356,7 @@ static int ocfs2_downconvert_thread_should_wake(struct ocfs2_super *osb)
        return should_wake;
 }
 
-int ocfs2_downconvert_thread(void *arg)
+static int ocfs2_downconvert_thread(void *arg)
 {
        int status = 0;
        struct ocfs2_super *osb = arg;