aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/dlmglue.c
diff options
context:
space:
mode:
authorLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2008-02-17 21:51:42 -0500
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2008-02-17 21:51:42 -0500
commitc58310bf4933986513020fa90b4190c7492995ae (patch)
tree143f2c7578d02ebef5db8fc57ae69e951ae0e2ee /fs/ocfs2/dlmglue.c
parent269cdfaf769f5cd831284cc831790c7c5038040f (diff)
parent1309d4e68497184d2fd87e892ddf14076c2bda98 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into for-linus
Diffstat (limited to 'fs/ocfs2/dlmglue.c')
-rw-r--r--fs/ocfs2/dlmglue.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c
index 3867244fb144..351130c9b734 100644
--- a/fs/ocfs2/dlmglue.c
+++ b/fs/ocfs2/dlmglue.c
@@ -43,6 +43,7 @@
43#include <cluster/masklog.h> 43#include <cluster/masklog.h>
44 44
45#include "ocfs2.h" 45#include "ocfs2.h"
46#include "ocfs2_lockingver.h"
46 47
47#include "alloc.h" 48#include "alloc.h"
48#include "dcache.h" 49#include "dcache.h"
@@ -258,6 +259,31 @@ static struct ocfs2_lock_res_ops ocfs2_flock_lops = {
258 .flags = 0, 259 .flags = 0,
259}; 260};
260 261
262/*
263 * This is the filesystem locking protocol version.
264 *
265 * Whenever the filesystem does new things with locks (adds or removes a
266 * lock, orders them differently, does different things underneath a lock),
267 * the version must be changed. The protocol is negotiated when joining
268 * the dlm domain. A node may join the domain if its major version is
269 * identical to all other nodes and its minor version is greater than
270 * or equal to all other nodes. When its minor version is greater than
271 * the other nodes, it will run at the minor version specified by the
272 * other nodes.
273 *
274 * If a locking change is made that will not be compatible with older
275 * versions, the major number must be increased and the minor version set
276 * to zero. If a change merely adds a behavior that can be disabled when
277 * speaking to older versions, the minor version must be increased. If a
278 * change adds a fully backwards compatible change (eg, LVB changes that
279 * are just ignored by older versions), the version does not need to be
280 * updated.
281 */
282const struct dlm_protocol_version ocfs2_locking_protocol = {
283 .pv_major = OCFS2_LOCKING_PROTOCOL_MAJOR,
284 .pv_minor = OCFS2_LOCKING_PROTOCOL_MINOR,
285};
286
261static inline int ocfs2_is_inode_lock(struct ocfs2_lock_res *lockres) 287static inline int ocfs2_is_inode_lock(struct ocfs2_lock_res *lockres)
262{ 288{
263 return lockres->l_type == OCFS2_LOCK_TYPE_META || 289 return lockres->l_type == OCFS2_LOCK_TYPE_META ||
@@ -2506,7 +2532,8 @@ int ocfs2_dlm_init(struct ocfs2_super *osb)
2506 dlm_key = crc32_le(0, osb->uuid_str, strlen(osb->uuid_str)); 2532 dlm_key = crc32_le(0, osb->uuid_str, strlen(osb->uuid_str));
2507 2533
2508 /* for now, uuid == domain */ 2534 /* for now, uuid == domain */
2509 dlm = dlm_register_domain(osb->uuid_str, dlm_key); 2535 dlm = dlm_register_domain(osb->uuid_str, dlm_key,
2536 &osb->osb_locking_proto);
2510 if (IS_ERR(dlm)) { 2537 if (IS_ERR(dlm)) {
2511 status = PTR_ERR(dlm); 2538 status = PTR_ERR(dlm);
2512 mlog_errno(status); 2539 mlog_errno(status);