diff options
author | Dmitry Antipov <dmantipov@yandex.ru> | 2020-08-11 11:44:18 +0300 |
---|---|---|
committer | Amar Tumballi <amar@kadalu.io> | 2020-08-21 14:05:26 +0000 |
commit | ac98f64a9be9cb2374e9cf124b03cc5bf791e81d (patch) | |
tree | 115945a6aba56a4bcd5612f21b77759a8914a2f3 /xlators/cluster/dht/src/dht-common.c | |
parent | 9bca9a0b42f888cb88cedc848d471dd32a6f62d0 (diff) |
cluster/dht: simplify and cleanup internal time management
Prefer time_t and gf_time() over 'struct timeval' and gettimeofday()
where microseconds are not really used, drop unneeded 'struct timeval'
to 'struct timespec' conversion in dht_file_counter_thread().
Change-Id: Ibd802f79b8848df3f6175ca1fd82e93532bba38d
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Updates: #1002
Diffstat (limited to 'xlators/cluster/dht/src/dht-common.c')
-rw-r--r-- | xlators/cluster/dht/src/dht-common.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index be92236e3bd..c564a078da7 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -10850,9 +10850,6 @@ dht_notify(xlator_t *this, int event, void *data, ...) int had_heard_from_all = 0; int have_heard_from_all = 0; - struct timeval time = { - 0, - }; gf_defrag_info_t *defrag = NULL; dict_t *dict = NULL; gf_defrag_type cmd = 0; @@ -10896,12 +10893,11 @@ dht_notify(xlator_t *this, int event, void *data, ...) break; } - gettimeofday(&time, NULL); LOCK(&conf->subvolume_lock); { conf->subvolume_status[cnt] = 1; conf->last_event[cnt] = event; - conf->subvol_up_time[cnt] = time.tv_sec; + conf->subvol_up_time[cnt] = gf_time(); } UNLOCK(&conf->subvolume_lock); |