From 334981987010f895594031f8363f481eb7ae6416 Mon Sep 17 00:00:00 2001 From: Pavan Vilas Sondur Date: Wed, 23 Sep 2009 06:03:25 +0000 Subject: Implemented inodelks with support for domains. Signed-off-by: Anand V. Avati 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 --- xlators/features/locks/src/locks.h | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 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 e427637bc0f..76d006cd53e 100644 --- a/xlators/features/locks/src/locks.h +++ b/xlators/features/locks/src/locks.h @@ -54,6 +54,30 @@ struct __posix_lock { }; typedef struct __posix_lock posix_lock_t; +struct __pl_inode_lock { + struct list_head list; + struct list_head blocked_locks; /* list_head pointing to blocked_inodelks */ + + short fl_type; + off_t fl_start; + off_t fl_end; + + const char *volume; + + struct flock user_flock; /* the flock supplied by the user */ + xlator_t *this; /* required for blocked locks */ + fd_t *fd; + + call_frame_t *frame; + + /* These two together serve to uniquely identify each process + across nodes */ + + transport_t *transport; /* to identify client node */ + pid_t client_pid; /* pid of client process */ +}; +typedef struct __pl_inode_lock pl_inode_lock_t; + struct __pl_rw_req_t { struct list_head list; call_stub_t *stub; @@ -67,6 +91,7 @@ struct __pl_dom_list_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 */ }; typedef struct __pl_dom_list_t pl_dom_list_t; @@ -96,17 +121,12 @@ struct __pl_inode { 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 */ int mandatory; /* if mandatory locking is enabled */ }; typedef struct __pl_inode pl_inode_t; -#define LOCKS_FOR_DOMAIN(inode,domain) (domain == GF_LOCK_POSIX \ - ? inode->fcntl_locks \ - : inode->inodelk_locks) - struct __pl_fd { gf_boolean_t nonblocking; /* whether O_NONBLOCK has been set */ }; -- cgit