summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2010-06-03 04:39:44 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-06-03 03:30:58 -0700
commitd23ae73d0e34010b464454ce81f53f44901ca544 (patch)
treec5c9a5c8ce14117673f7cf2a8b7afd80520d93fe /xlators
parentf6048901a2068af13e21ba66b41a0667b740b1d4 (diff)
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 <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
Diffstat (limited to 'xlators')
-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 fd15b9d40..33ab66183 100644
--- a/xlators/performance/quick-read/src/quick-read.c
+++ b/xlators/performance/quick-read/src/quick-read.c
@@ -259,7 +259,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) {
@@ -280,7 +280,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);
}