From 7bf78408ffec1efbceed17ed2e540d7d0af19763 Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Fri, 16 Oct 2009 09:12:57 +0000 Subject: locks: keep ref on the inode while locks are held keeping refs on the inode while there are held locks prevents the inode from getting pruned away Signed-off-by: Anand V. Avati BUG: 315 (generation number support) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=315 --- xlators/features/locks/src/locks.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'xlators/features/locks/src/locks.h') diff --git a/xlators/features/locks/src/locks.h b/xlators/features/locks/src/locks.h index 4ad16c714ec..9d030f15e13 100644 --- a/xlators/features/locks/src/locks.h +++ b/xlators/features/locks/src/locks.h @@ -86,12 +86,12 @@ struct __pl_rw_req_t { typedef struct __pl_rw_req_t pl_rw_req_t; struct __pl_dom_list_t { - const char *domain; - struct list_head inode_list; /* list_head back to pl_inode_t */ - struct list_head entrylk_list; /* List of entry locks */ - struct list_head blocked_entrylks; /* List of all blocked entrylks */ - struct list_head inodelk_list; /* List of inode locks */ - struct list_head blocked_inodelks; /* List of all blocked inodelks */ + struct list_head inode_list; /* list_head back to pl_inode_t */ + const char *domain; + struct list_head entrylk_list; /* List of entry locks */ + struct list_head blocked_entrylks; /* List of all blocked entrylks */ + struct list_head inodelk_list; /* List of inode locks */ + struct list_head blocked_inodelks; /* List of all blocked inodelks */ }; typedef struct __pl_dom_list_t pl_dom_list_t; @@ -123,6 +123,9 @@ struct __pl_inode { struct list_head ext_list; /* list of fcntl locks */ struct list_head rw_list; /* list of waiting r/w requests */ int mandatory; /* if mandatory locking is enabled */ + + inode_t *refkeeper; /* hold refs on an inode while locks are + held to prevent pruning */ }; typedef struct __pl_inode pl_inode_t; -- cgit