From 62997e7b716e62400ad5448d7d19e69565035a2f Mon Sep 17 00:00:00 2001 From: Tomohiro Kusumi Date: Sat, 17 Dec 2016 01:46:05 +0900 Subject: [PATCH] sbin/hammer: Use HAMMER_BUFSIZE to calculate CacheMax CacheMax is to be compared with multiple of HAMMER_BUFSIZE, so use HAMMER_BUFSIZE to initialize CacheMax. --- sbin/hammer/cache.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/hammer/cache.c b/sbin/hammer/cache.c index 143864eec0..efcd9898ce 100644 --- a/sbin/hammer/cache.c +++ b/sbin/hammer/cache.c @@ -37,7 +37,7 @@ #include "hammer_util.h" static int CacheUse; -static int CacheMax = 16 * 1024 * 1024; +static int CacheMax = HAMMER_BUFSIZE * 1024; static int NCache; static TAILQ_HEAD(, cache_info) CacheList = TAILQ_HEAD_INITIALIZER(CacheList); @@ -126,7 +126,7 @@ hammer_cache_flush(void) continue; } if (count >= NCache) { - CacheMax += 8 * 1024 * 1024; + CacheMax += HAMMER_BUFSIZE * 512; target = CacheMax / 2; count = 1; } -- 2.11.4.GIT