summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2009-11-09 18:42:54 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-11-13 04:21:16 -0800
commitc65e5463f22bb2ef8120ac89db19f3d6c11fe62f (patch)
treecc77fd2f3ea9167345f3a41ef2b7976c15ab630b
parent19cc1fa99cb0f02fd81b430eb7cce0a55b08d6e5 (diff)
performance/stat-prefetch: allocate and init local only if cache-miss happens in lookup.
Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 284 (performance actually decreases for 'ls -l' on a directory containing large number of files with stat-prefetch loaded) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=284
-rw-r--r--xlators/performance/stat-prefetch/src/stat-prefetch.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/xlators/performance/stat-prefetch/src/stat-prefetch.c b/xlators/performance/stat-prefetch/src/stat-prefetch.c
index 28fc71948..5c881f70a 100644
--- a/xlators/performance/stat-prefetch/src/stat-prefetch.c
+++ b/xlators/performance/stat-prefetch/src/stat-prefetch.c
@@ -796,6 +796,11 @@ wind:
if (cache) {
cache->hits++;
}
+ } else {
+ if (cache) {
+ cache->miss++;
+ }
+
LOCK (&inode_ctx->lock);
{
if (!(inode_ctx->looked_up
@@ -820,10 +825,6 @@ wind:
}
local->is_lookup = 1;
- } else {
- if (cache) {
- cache->miss++;
- }
STACK_WIND (frame, sp_lookup_cbk, FIRST_CHILD(this),
FIRST_CHILD(this)->fops->lookup, loc, xattr_req);