diff options
Diffstat (limited to 'cache.c')
-rw-r--r-- | cache.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -105,6 +105,9 @@ static void cache_purge_parent(const char *path) void cache_invalidate(const char *path) { + if (!cache.on) + return; + pthread_mutex_lock(&cache.lock); cache_purge(path); pthread_mutex_unlock(&cache.lock); @@ -163,6 +166,9 @@ void cache_add_attr(const char *path, const struct stat *stbuf, uint64_t wrctr) struct node *node; time_t now; + if (!cache.on) + return; + pthread_mutex_lock(&cache.lock); if (wrctr == cache.write_ctr) { node = cache_get(path); |