summaryrefslogtreecommitdiffstats
path: root/xlators/features/locks/src/locks.h
diff options
context:
space:
mode:
authorAnand Avati <avati@gluster.com>2009-10-16 09:12:57 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-10-16 08:04:31 -0700
commit7bf78408ffec1efbceed17ed2e540d7d0af19763 (patch)
tree98a1c9b8ae048867242932ac00054fd4728c45d2 /xlators/features/locks/src/locks.h
parent5d423ab4548c941921c1e64135fec6e15c7787f2 (diff)
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 <avati@dev.gluster.com> BUG: 315 (generation number support) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=315
Diffstat (limited to 'xlators/features/locks/src/locks.h')
-rw-r--r--xlators/features/locks/src/locks.h15
1 files changed, 9 insertions, 6 deletions
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;