summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-snapshot.c
diff options
context:
space:
mode:
authorDmitry Antipov <dmantipov@yandex.ru>2020-09-03 11:17:07 +0300
committerAmar Tumballi <amar@kadalu.io>2020-09-07 12:56:45 +0000
commitc696144b3690f7ed8cf04a8b51ca601f45e427ad (patch)
tree5b8e2e145e0cde67fa35901feec77922e447e83c /xlators/mgmt/glusterd/src/glusterd-snapshot.c
parenta1c89afd79a1ed08e37a4b5d17911ae29488eb8c (diff)
downloadglusterfs-c696144b3690f7ed8cf04a8b51ca601f45e427ad.tar.gz
glusterfs-c696144b3690f7ed8cf04a8b51ca601f45e427ad.tar.xz
glusterfs-c696144b3690f7ed8cf04a8b51ca601f45e427ad.zip
xlators: prefer libglusterfs time API
Prefer timespec_now_realtime() and gf_time() over clock_gettime() and time(), use gf_tvdiff() and gf_tsdiff() where appropriate, drop unused time_elapsed() and leftovers in 'struct posix_private'. Change-Id: Ie1f0229df5b03d0862193ce2b7fb91d27b0981b6 Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru> Updates: #1002
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-snapshot.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-snapshot.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot.c b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
index ddf394e2c5..aeaa8d1521 100644
--- a/xlators/mgmt/glusterd/src/glusterd-snapshot.c
+++ b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
@@ -3930,7 +3930,8 @@ glusterd_handle_snapshot_create(rpcsvc_request_t *req, glusterd_op_t op,
goto out;
}
- ret = dict_set_int64(dict, "snap-time", (int64_t)time(&snap_time));
+ snap_time = gf_time();
+ ret = dict_set_int64(dict, "snap-time", (int64_t)snap_time);
if (ret) {
gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_DICT_SET_FAILED,
"Unable to set snap-time");