Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 35499
b: refs/heads/master
c: b80fc01
h: refs/heads/master
i:
  35497: 79a1fea
  35495: 8cd51ba
v: v3
  • Loading branch information
Mark Fasheh committed Sep 24, 2006
1 parent 3616ec5 commit 01cf8fd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: aa2623ad80577b37637914e809bafa36994ccdf1
refs/heads/master: b80fc012e03f8f207911b5eafe6916b000e03c8b
18 changes: 15 additions & 3 deletions trunk/fs/ocfs2/dlmglue.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@ struct ocfs2_lock_res_ops {
*/
#define LOCK_TYPE_REQUIRES_REFRESH 0x1

/*
* Indicate that a lock type makes use of the lock value block.
*/
#define LOCK_TYPE_USES_LVB 0x2

typedef int (ocfs2_convert_worker_t)(struct ocfs2_lock_res *, int);
static int ocfs2_generic_unblock_lock(struct ocfs2_super *osb,
struct ocfs2_lock_res *lockres,
Expand All @@ -150,7 +155,7 @@ static struct ocfs2_lock_res_ops ocfs2_inode_rw_lops = {
static struct ocfs2_lock_res_ops ocfs2_inode_meta_lops = {
.get_osb = ocfs2_get_inode_osb,
.unblock = ocfs2_unblock_meta,
.flags = LOCK_TYPE_REQUIRES_REFRESH,
.flags = LOCK_TYPE_REQUIRES_REFRESH|LOCK_TYPE_USES_LVB,
};

static struct ocfs2_lock_res_ops ocfs2_inode_data_lops = {
Expand Down Expand Up @@ -870,6 +875,9 @@ static int ocfs2_cluster_lock(struct ocfs2_super *osb,

ocfs2_init_mask_waiter(&mw);

if (lockres->l_ops->flags & LOCK_TYPE_USES_LVB)
lkm_flags |= LKM_VALBLK;

again:
wait = 0;

Expand Down Expand Up @@ -937,7 +945,7 @@ static int ocfs2_cluster_lock(struct ocfs2_super *osb,
status = dlmlock(osb->dlm,
level,
&lockres->l_lksb,
lkm_flags|LKM_CONVERT|LKM_VALBLK,
lkm_flags|LKM_CONVERT,
lockres->l_name,
OCFS2_LOCK_ID_MAX_LEN - 1,
ocfs2_locking_ast,
Expand Down Expand Up @@ -2212,11 +2220,15 @@ static int ocfs2_drop_lock(struct ocfs2_super *osb,
{
enum dlm_status status;
unsigned long flags;
int lkm_flags = 0;

/* We didn't get anywhere near actually using this lockres. */
if (!(lockres->l_flags & OCFS2_LOCK_INITIALIZED))
goto out;

if (lockres->l_ops->flags & LOCK_TYPE_USES_LVB)
lkm_flags |= LKM_VALBLK;

spin_lock_irqsave(&lockres->l_lock, flags);

mlog_bug_on_msg(!(lockres->l_flags & OCFS2_LOCK_FREEING),
Expand Down Expand Up @@ -2266,7 +2278,7 @@ static int ocfs2_drop_lock(struct ocfs2_super *osb,

mlog(0, "lock %s\n", lockres->l_name);

status = dlmunlock(osb->dlm, &lockres->l_lksb, LKM_VALBLK,
status = dlmunlock(osb->dlm, &lockres->l_lksb, lkm_flags,
ocfs2_unlock_ast, lockres);
if (status != DLM_NORMAL) {
ocfs2_log_dlm_error("dlmunlock", status, lockres);
Expand Down

0 comments on commit 01cf8fd

Please sign in to comment.