summaryrefslogtreecommitdiffstats
path: root/xlators/performance
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/performance')
-rw-r--r--xlators/performance/md-cache/src/md-cache.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/xlators/performance/md-cache/src/md-cache.c b/xlators/performance/md-cache/src/md-cache.c
index 186b352fba5..779e78656c0 100644
--- a/xlators/performance/md-cache/src/md-cache.c
+++ b/xlators/performance/md-cache/src/md-cache.c
@@ -1079,18 +1079,17 @@ mdc_load_statfs_info_from_cache(xlator_t *this, struct statvfs **buf)
goto err;
}
+ *buf = NULL;
+ timespec_now(&now);
+
pthread_mutex_lock(&conf->statfs_cache.lock);
{
- *buf = NULL;
-
/* Skip if the cache is not initialized */
if (!conf->statfs_cache.initialized) {
ret = -1;
goto unlock;
}
- timespec_now(&now);
-
cache_age = (now.tv_sec - conf->statfs_cache.last_refreshed.tv_sec);
gf_log(this->name, GF_LOG_DEBUG, "STATFS cache age = %lf", cache_age);