diff options
author | Prasanna Kumar Kalever <prasanna.kalever@redhat.com> | 2017-06-01 15:08:44 +0530 |
---|---|---|
committer | Prasanna Kumar Kalever <prasanna.kalever@redhat.com> | 2017-06-05 22:12:20 +0530 |
commit | 15d9ee36c71bfe3499d7f3baf3a483199211261f (patch) | |
tree | a085afa3fabe33aab37128a7f140f69032c4844f /utils/lru.c | |
parent | 3994aa8cf1bdcf3a07cddfefdb96cc2b94e01a97 (diff) |
daemon: make glfs lru cache capacity configurable
$ gluster-blockd --help
gluster-blockd (0.2)
usage:
gluster-blockd [--glfs-lru-count <count>]
commands:
--glfs-lru-count <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 <prasanna.kalever@redhat.com>
Diffstat (limited to 'utils/lru.c')
-rw-r--r-- | utils/lru.c | 5 |
1 files changed, 2 insertions, 3 deletions
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(); } |