From 15d9ee36c71bfe3499d7f3baf3a483199211261f Mon Sep 17 00:00:00 2001 From: Prasanna Kumar Kalever Date: Thu, 1 Jun 2017 15:08:44 +0530 Subject: daemon: make glfs lru cache capacity configurable $ gluster-blockd --help gluster-blockd (0.2) usage: gluster-blockd [--glfs-lru-count ] commands: --glfs-lru-count glfs objects cache capacity [max: 512] (default: 5) --help show this message and exit. --version show version info and exit. Change-Id: I00a9277690a1c5ace51e223e9e4ed9ce61ae2428 Signed-off-by: Prasanna Kumar Kalever --- utils/lru.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'utils/lru.c') diff --git a/utils/lru.c b/utils/lru.c index f1e884b..7fd036e 100644 --- a/utils/lru.c +++ b/utils/lru.c @@ -10,11 +10,10 @@ # include "lru.h" -# define LRU_CAPACITY 5 - static struct list_head Cache; static int lruCount; +size_t glfsLruCount = 5; /* default lru cache size */ typedef struct Entry { char volume[256]; @@ -50,7 +49,7 @@ appendNewEntry(const char *volname, glfs_t *fs) Entry *tmp; - if (lruCount == LRU_CAPACITY) { + if (lruCount == glfsLruCount) { releaseColdEntry(); } -- cgit