From c65e5463f22bb2ef8120ac89db19f3d6c11fe62f Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Mon, 9 Nov 2009 18:42:54 +0000 Subject: performance/stat-prefetch: allocate and init local only if cache-miss happens in lookup. Signed-off-by: Raghavendra G Signed-off-by: Anand V. Avati 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 --- xlators/performance/stat-prefetch/src/stat-prefetch.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'xlators') 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); -- cgit