From ac98f64a9be9cb2374e9cf124b03cc5bf791e81d Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Tue, 11 Aug 2020 11:44:18 +0300 Subject: 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 Updates: #1002 --- xlators/cluster/dht/src/dht-common.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'xlators/cluster/dht/src/dht-common.c') 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); -- cgit