summaryrefslogtreecommitdiffstats
path: root/xlators/features/locks/src/locks.h
diff options
context:
space:
mode:
authorYaniv Kaul <ykaul@redhat.com>2018-12-02 23:19:46 +0200
committerAmar Tumballi <amarts@redhat.com>2018-12-14 04:53:36 +0000
commite3d01793a3ef1307240fdc7d7f0d12be1488b921 (patch)
tree8c6b6d33fb7df70b17ba7469972e9f633a0158c4 /xlators/features/locks/src/locks.h
parent2421453bf38469a8c0861f205bdee37e771aa39f (diff)
Multiple posix related files: several modifications
Just looked at posix.c and related code and performed some changes and cleanups. The only important one is #3 below, but surely the others (#2 and #4) need careful review. Changes to other files are as they were related to code paths in posix.c. I'll send a separate patch for other posix related files. Main changes: 1. Proper initializtion for parameters, where it made sense. 2. Logged outside the lock in several places. 3. Moved from CALLOC to MALLOC where it made sense. 4. Aligned structures. 5. moved dictionary functions to use _sizen where possible. (dict_get() -> dict_get_sizen() for example) Compile-tested only! Change-Id: Ia84699fb495e06d095339c91c1ba770d1393bb6c updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
Diffstat (limited to 'xlators/features/locks/src/locks.h')
-rw-r--r--xlators/features/locks/src/locks.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/xlators/features/locks/src/locks.h b/xlators/features/locks/src/locks.h
index 0b5671bce24..34776e1f62b 100644
--- a/xlators/features/locks/src/locks.h
+++ b/xlators/features/locks/src/locks.h
@@ -30,11 +30,11 @@ struct __pl_fd;
struct __posix_lock {
struct list_head list;
- short fl_type;
off_t fl_start;
off_t fl_end;
uint32_t lk_flags;
+ short fl_type;
short blocked; /* waiting to acquire */
struct gf_flock user_flock; /* the flock supplied by the user */
xlator_t *this; /* required for blocked locks */
@@ -74,7 +74,6 @@ struct __pl_inode_lock {
struct list_head contend; /* list of contending locks */
int ref;
- short fl_type;
off_t fl_start;
off_t fl_end;
@@ -102,6 +101,7 @@ struct __pl_inode_lock {
char *connection_id; /* stores the client connection id */
struct list_head client_list; /* list of all locks from a client */
+ short fl_type;
};
typedef struct __pl_inode_lock pl_inode_lock_t;
@@ -135,7 +135,6 @@ struct __entry_lock {
const char *volume;
const char *basename;
- entrylk_type type;
struct timeval blkd_time; /*time at which lock was queued into blkd list*/
struct timeval
@@ -150,6 +149,7 @@ struct __entry_lock {
char *connection_id; /* stores the client connection id */
struct list_head client_list; /* list of all locks from a client */
+ entrylk_type type;
};
typedef struct __entry_lock pl_entry_lock_t;
@@ -196,22 +196,18 @@ struct __pl_metalk {
typedef struct __pl_metalk pl_meta_lock_t;
typedef struct {
+ char *brickname;
+ uint32_t revocation_secs;
+ uint32_t revocation_max_blocked;
+ uint32_t notify_contention_delay;
mlk_mode_t mandatory_mode; /* holds current mandatory locking mode */
gf_boolean_t trace; /* trace lock requests in and out */
- char *brickname;
gf_boolean_t monkey_unlocking;
- uint32_t revocation_secs;
gf_boolean_t revocation_clear_all;
- uint32_t revocation_max_blocked;
gf_boolean_t notify_contention;
- uint32_t notify_contention_delay;
} posix_locks_private_t;
typedef struct {
- gf_boolean_t entrylk_count_req;
- gf_boolean_t inodelk_count_req;
- gf_boolean_t posixlk_count_req;
- gf_boolean_t parent_entrylk_req;
data_t *inodelk_dom_count_req;
dict_t *xdata;
@@ -219,6 +215,10 @@ typedef struct {
fd_t *fd;
off_t offset;
glusterfs_fop_t op;
+ gf_boolean_t entrylk_count_req;
+ gf_boolean_t inodelk_count_req;
+ gf_boolean_t posixlk_count_req;
+ gf_boolean_t parent_entrylk_req;
} pl_local_t;
typedef struct {