diff options
| author | Raghavendra G <raghavendra@gluster.com> | 2009-10-08 06:21:04 +0000 | 
|---|---|---|
| committer | Anand V. Avati <avati@dev.gluster.com> | 2009-10-09 00:48:26 -0700 | 
| commit | 5c3bd66db8a911ca4da021d76237970c9eabd66c (patch) | |
| tree | 98c28701f56141e4ef42ee958b9276b42e4f88fa | |
| parent | 78da899c5ceac63c424ad3d9e712b6a26abae7ba (diff) | |
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 <avati@dev.gluster.com>
BUG: 221 (stat prefetch implementation)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=221
| -rw-r--r-- | xlators/performance/stat-prefetch/src/stat-prefetch.c | 13 | 
1 files changed, 12 insertions, 1 deletions
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) {  | 
