diff options
Diffstat (limited to 'fs/ocfs2/dlmglue.c')
| -rw-r--r-- | fs/ocfs2/dlmglue.c | 29 |
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 | */ | ||
| 282 | const struct dlm_protocol_version ocfs2_locking_protocol = { | ||
| 283 | .pv_major = OCFS2_LOCKING_PROTOCOL_MAJOR, | ||
| 284 | .pv_minor = OCFS2_LOCKING_PROTOCOL_MINOR, | ||
| 285 | }; | ||
| 286 | |||
| 261 | static inline int ocfs2_is_inode_lock(struct ocfs2_lock_res *lockres) | 287 | static 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); |
