diff options
author | Dmitry Antipov <dmantipov@yandex.ru> | 2020-08-10 11:45:58 +0300 |
---|---|---|
committer | Amar Tumballi <amar@kadalu.io> | 2020-08-17 11:27:09 +0000 |
commit | 9978ceb26327de9545c6e0a4f9230b401e629793 (patch) | |
tree | 19468386ccc3f04bfc7a059d6de5710cfd1e88fd /libglusterfs/src/gidcache.c | |
parent | 005d2ac1d8cc57e0e36f7cf230ae09a4f860bd16 (diff) |
libglusterfs: add library wrapper for time()
Add thin convenient library wrapper gf_time(),
adjust related users and comments as well.
Change-Id: If8969af2f45ee69c30c3406bce5baa8305fb7f80
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Updates: #1002
Diffstat (limited to 'libglusterfs/src/gidcache.c')
-rw-r--r-- | libglusterfs/src/gidcache.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libglusterfs/src/gidcache.c b/libglusterfs/src/gidcache.c index 40fcffbb35e..64a93802f76 100644 --- a/libglusterfs/src/gidcache.c +++ b/libglusterfs/src/gidcache.c @@ -10,6 +10,7 @@ #include "glusterfs/gidcache.h" #include "glusterfs/mem-pool.h" +#include "glusterfs/common-utils.h" /* * We treat this as a very simple set-associative LRU cache, with entries aged @@ -64,7 +65,7 @@ gid_cache_lookup(gid_cache_t *cache, uint64_t id, uint64_t uid, uint64_t gid) time_t now; const gid_list_t *agl; - now = time(NULL); + now = gf_time(); LOCK(&cache->gc_lock); bucket = id % cache->gc_nbuckets; agl = BUCKET_START(cache->gc_cache, bucket); @@ -132,7 +133,7 @@ gid_cache_add(gid_cache_t *cache, gid_list_t *gl) if (!cache->gc_max_age) return 0; - now = time(NULL); + now = gf_time(); LOCK(&cache->gc_lock); /* |