summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2010-06-03 04:21:50 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-06-03 03:31:02 -0700
commite3386037471423aa0ee88ddc081296780e9070e4 (patch)
tree3688025e226fc8bba262dbdf1cdd5b53edb6da4f
parent3f86b2040c26bd5fd95cfd80a353537919da1662 (diff)
performance/quick-read: fix the size-to-be pruned.v3.0.5rc4
- 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 <raghavendra@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 980 (quick read - fetching from backend issue) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=980
-rw-r--r--xlators/performance/quick-read/src/quick-read.c4
1 files 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);
}