diff options
author | Dmitry Antipov <dmantipov@yandex.ru> | 2020-08-07 12:43:44 +0300 |
---|---|---|
committer | Amar Tumballi <amar@kadalu.io> | 2020-08-21 14:06:09 +0000 |
commit | a2ffb748da24b2e9d6f5e98d21ef78d1a17d31cb (patch) | |
tree | 1bf16e186644243bcc0bafcb6ae011d5951280c1 /xlators/features/locks/src/locks.h | |
parent | ac98f64a9be9cb2374e9cf124b03cc5bf791e81d (diff) |
features/locks: simplify and cleanup internal time management
Since this xlator measures time intervals in seconds,
gettimeofday() may be replaced with simpler gf_time().
Change-Id: Ib2c81376c093613124bdbed184516077cbe80dac
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Updates: #1002
Diffstat (limited to 'xlators/features/locks/src/locks.h')
-rw-r--r-- | xlators/features/locks/src/locks.h | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/xlators/features/locks/src/locks.h b/xlators/features/locks/src/locks.h index 93c2973b2b3..c868eb494a2 100644 --- a/xlators/features/locks/src/locks.h +++ b/xlators/features/locks/src/locks.h @@ -43,9 +43,8 @@ struct __posix_lock { fd_t *fd; call_frame_t *frame; - struct timeval blkd_time; /*time at which lock was queued into blkd list*/ - struct timeval - granted_time; /*time at which lock was queued into active list*/ + time_t blkd_time; /* time at which lock was queued into blkd list */ + time_t granted_time; /* time at which lock was queued into active list */ /* These two together serve to uniquely identify each process across nodes */ @@ -85,9 +84,9 @@ struct __pl_inode_lock { call_frame_t *frame; - struct timeval blkd_time; /*time at which lock was queued into blkd list*/ - struct timeval - granted_time; /*time at which lock was queued into active list*/ + time_t blkd_time; /* time at which lock was queued into blkd list */ + time_t granted_time; /* time at which lock was queued into active list */ + /*last time at which lock contention was detected and notified*/ struct timespec contention_time; @@ -139,9 +138,9 @@ struct __entry_lock { const char *basename; - struct timeval blkd_time; /*time at which lock was queued into blkd list*/ - struct timeval - granted_time; /*time at which lock was queued into active list*/ + time_t blkd_time; /* time at which lock was queued into blkd list */ + time_t granted_time; /* time at which lock was queued into active list */ + /*last time at which lock contention was detected and notified*/ struct timespec contention_time; |