From e3386037471423aa0ee88ddc081296780e9070e4 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Thu, 3 Jun 2010 04:21:50 +0000 Subject: performance/quick-read: fix the size-to-be pruned. - size-to-be pruned used to be a negative number because of cache-used being subtracted from configured cache-limit (with cache-used > cache-limit). Signed-off-by: Raghavendra G Signed-off-by: Anand V. Avati BUG: 980 (quick read - fetching from backend issue) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=980 --- xlators/performance/quick-read/src/quick-read.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xlators/performance/quick-read/src/quick-read.c b/xlators/performance/quick-read/src/quick-read.c index 34b755d26a7..5cdceb4aeb3 100644 --- a/xlators/performance/quick-read/src/quick-read.c +++ b/xlators/performance/quick-read/src/quick-read.c @@ -261,7 +261,7 @@ __qr_cache_prune (xlator_t *this) table = &priv->table; conf = &priv->conf; - size_to_prune = conf->cache_size - table->cache_used; + size_to_prune = table->cache_used - conf->cache_size; for (index=0; index < conf->max_pri; index++) { list_for_each_entry_safe (curr, next, &table->lru[index], lru) { @@ -283,7 +283,7 @@ done: inline char __qr_need_cache_prune (qr_conf_t *conf, qr_inode_table_t *table) { - return (table->cache_used >= conf->cache_size); + return (table->cache_used > conf->cache_size); } -- cgit