From 5c3bd66db8a911ca4da021d76237970c9eabd66c Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Thu, 8 Oct 2009 06:21:04 +0000 Subject: performance/stat-prefetch: optimizations to sp_lookup. - if stat cache cannot be found for a path in its parent inode and the path is a directory, we can get the cache from the inode corresponding to path and look for "." in that cache. Signed-off-by: Anand V. Avati BUG: 221 (stat prefetch implementation) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=221 --- xlators/performance/stat-prefetch/src/stat-prefetch.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'xlators/performance') diff --git a/xlators/performance/stat-prefetch/src/stat-prefetch.c b/xlators/performance/stat-prefetch/src/stat-prefetch.c index 0adfded8d87..dee52e8c6af 100644 --- a/xlators/performance/stat-prefetch/src/stat-prefetch.c +++ b/xlators/performance/stat-prefetch/src/stat-prefetch.c @@ -593,7 +593,18 @@ sp_lookup (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xattr_req) lookup_behind = 1; } } - } + } else if (S_ISDIR (loc->inode->st_mode)) { + cache = sp_get_cache_inode (this, loc->inode, frame->root->pid); + if (cache) { + ret = sp_cache_get_entry (cache, ".", &dirent); + if (ret == 0) { + buf = &dirent.d_stat; + op_ret = 0; + op_errno = 0; + lookup_behind = 1; + } + } + } wind: if (lookup_behind) { -- cgit