Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 30688
b: refs/heads/master
c: 6ff06a9
h: refs/heads/master
v: v3
  • Loading branch information
Kurt Hackel authored and Mark Fasheh committed Jun 26, 2006
1 parent 5b5eb00 commit d81632b
Show file tree
Hide file tree
Showing 3 changed files with 18 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: e7e69eb38946ebef86e27442d01514fcf9c854ee
refs/heads/master: 6ff06a93916b3f95e83c346f7530cf2f5c68ae0c
14 changes: 11 additions & 3 deletions trunk/fs/ocfs2/dlm/dlmcommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,18 +235,26 @@ struct dlm_lock_resource
struct qstr lockname;
struct kref refs;

/* please keep these next 3 in this order
* some funcs want to iterate over all lists */
/*
* Please keep granted, converting, and blocked in this order,
* as some funcs want to iterate over all lists.
*
* All four lists are protected by the hash's reference.
*/
struct list_head granted;
struct list_head converting;
struct list_head blocked;
struct list_head purge;

/*
* These two lists require you to hold an additional reference
* while they are on the list.
*/
struct list_head dirty;
struct list_head recovering; // dlm_recovery_ctxt.resources list

/* unused lock resources have their last_used stamped and are
* put on a list for the dlm thread to run. */
struct list_head purge;
unsigned long last_used;

unsigned migration_pending:1;
Expand Down
6 changes: 6 additions & 0 deletions trunk/fs/ocfs2/dlm/dlmthread.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,8 @@ void __dlm_dirty_lockres(struct dlm_ctxt *dlm, struct dlm_lock_resource *res)
/* don't shuffle secondary queues */
if ((res->owner == dlm->node_num) &&
!(res->state & DLM_LOCK_RES_DIRTY)) {
/* ref for dirty_list */
dlm_lockres_get(res);
list_add_tail(&res->dirty, &dlm->dirty_list);
res->state |= DLM_LOCK_RES_DIRTY;
}
Expand Down Expand Up @@ -639,6 +641,8 @@ static int dlm_thread(void *data)
list_del_init(&res->dirty);
spin_unlock(&res->spinlock);
spin_unlock(&dlm->spinlock);
/* Drop dirty_list ref */
dlm_lockres_put(res);

/* lockres can be re-dirtied/re-added to the
* dirty_list in this gap, but that is ok */
Expand Down Expand Up @@ -691,6 +695,8 @@ static int dlm_thread(void *data)
/* if the lock was in-progress, stick
* it on the back of the list */
if (delay) {
/* ref for dirty_list */
dlm_lockres_get(res);
spin_lock(&res->spinlock);
list_add_tail(&res->dirty, &dlm->dirty_list);
res->state |= DLM_LOCK_RES_DIRTY;
Expand Down

0 comments on commit d81632b

Please sign in to comment.