diff options
author | Dmitry Antipov <dmantipov@yandex.ru> | 2020-09-03 11:11:31 +0300 |
---|---|---|
committer | Amar Tumballi <amar@kadalu.io> | 2020-09-07 12:56:08 +0000 |
commit | 9b553b3ddfdde52ba80aacd8f32bcb27569b5cbc (patch) | |
tree | 8ec754b87803f03138203870f03ed23650784b98 /rpc/rpc-lib/src | |
parent | 4e81a5e47aeee6f5d18387b7af161488cf0f30fa (diff) | |
download | glusterfs-9b553b3ddfdde52ba80aacd8f32bcb27569b5cbc.tar.gz glusterfs-9b553b3ddfdde52ba80aacd8f32bcb27569b5cbc.tar.xz glusterfs-9b553b3ddfdde52ba80aacd8f32bcb27569b5cbc.zip |
glusterfsd, libglusterfs, rpc: prefer libglusterfs time API
Use timespec_now_realtime() rather than clock_gettime().
Change-Id: I8fa00b7c0f7b388305c7d19574be3b409db68558
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Updates: #1002
Diffstat (limited to 'rpc/rpc-lib/src')
-rw-r--r-- | rpc/rpc-lib/src/rpc-clnt-ping.c | 2 | ||||
-rw-r--r-- | rpc/rpc-lib/src/rpc-clnt.c | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/rpc/rpc-lib/src/rpc-clnt-ping.c b/rpc/rpc-lib/src/rpc-clnt-ping.c index 2298ef6394..31f17841be 100644 --- a/rpc/rpc-lib/src/rpc-clnt-ping.c +++ b/rpc/rpc-lib/src/rpc-clnt-ping.c @@ -122,7 +122,7 @@ rpc_clnt_ping_timer_expired(void *rpc_ptr) goto out; } - clock_gettime(CLOCK_REALTIME, ¤t); + timespec_now_realtime(¤t); pthread_mutex_lock(&conn->lock); { unref = rpc_clnt_remove_ping_timer_locked(rpc); diff --git a/rpc/rpc-lib/src/rpc-clnt.c b/rpc/rpc-lib/src/rpc-clnt.c index 2b0ec29552..517037c4a5 100644 --- a/rpc/rpc-lib/src/rpc-clnt.c +++ b/rpc/rpc-lib/src/rpc-clnt.c @@ -919,7 +919,7 @@ rpc_clnt_notify(rpc_transport_t *trans, void *mydata, } case RPC_TRANSPORT_MSG_RECEIVED: { - clock_gettime(CLOCK_REALTIME, &conn->last_received); + timespec_now_realtime(&conn->last_received); pollin = data; if (pollin->is_reply) @@ -933,8 +933,7 @@ rpc_clnt_notify(rpc_transport_t *trans, void *mydata, } case RPC_TRANSPORT_MSG_SENT: { - clock_gettime(CLOCK_REALTIME, &conn->last_sent); - + timespec_now_realtime(&conn->last_sent); ret = 0; break; } |