summaryrefslogtreecommitdiffstats
path: root/xlators/features/locks/src/locks.h
diff options
context:
space:
mode:
authorPavan Vilas Sondur <pavan@dev.gluster.com>2009-09-23 06:02:55 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-09-23 06:27:30 -0700
commit231196910d9d36af9546ddc511b26da5628b3ab8 (patch)
treee12dd77d1739f4eb7777d27b0d66c1683966d409 /xlators/features/locks/src/locks.h
parent435b28132b8f276681d19ae14fa988d26a16f659 (diff)
Implemented entry locks and support for domains.
Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 222 (Enhance Internal locks to support multilple domains and rewrite inodelks) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=222
Diffstat (limited to 'xlators/features/locks/src/locks.h')
-rw-r--r--xlators/features/locks/src/locks.h24
1 files changed, 17 insertions, 7 deletions
diff --git a/xlators/features/locks/src/locks.h b/xlators/features/locks/src/locks.h
index 5a834657d0b..e427637bc0f 100644
--- a/xlators/features/locks/src/locks.h
+++ b/xlators/features/locks/src/locks.h
@@ -61,30 +61,40 @@ 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 */
+};
+typedef struct __pl_dom_list_t pl_dom_list_t;
struct __entry_lock {
- struct list_head inode_list; /* list_head back to pl_inode_t */
- struct list_head blocked_locks; /* locks blocked due to this lock */
+ struct list_head domain_list; /* list_head back to pl_dom_list_t */
+ struct list_head blocked_locks; /* list_head back to blocked_entrylks */
call_frame_t *frame;
xlator_t *this;
- int blocked;
-
+
+ const char *volume;
+
const char *basename;
entrylk_type type;
- unsigned int read_count; /* number of read locks */
+
transport_t *trans;
+ pid_t client_pid; /* pid of client process */
};
typedef struct __entry_lock pl_entry_lock_t;
-/* The "simulated" inode. This contains a list of all the locks associated
+/* The "simulated" inode. This contains a list of all the locks associated
with this file */
struct __pl_inode {
pthread_mutex_t mutex;
- struct list_head dir_list; /* list of entry locks */
+ struct list_head dom_list; /* list of domains */
struct list_head ext_list; /* list of fcntl locks */
struct list_head int_list; /* list of internal locks */
struct list_head rw_list; /* list of waiting r/w requests */