diff options
author | Raghavendra G <raghavendra@gluster.com> | 2009-10-07 10:09:18 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-10-07 23:05:30 -0700 |
commit | f9142a9831e0b7d1da66d83b09f07c06e0f5e714 (patch) | |
tree | f50484fc960b79ea3186287f70bbf538522a4b27 /xlators | |
parent | 575cb7ed94cb08ecc8bd3556355231c6ac3f343b (diff) |
performance/stat-prefetch: remove stat corresponding to oldloc->path from cache in sp_link.
- ctime of oldloc->path will be changed on completion of link fop.
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
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/performance/stat-prefetch/src/stat-prefetch.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/xlators/performance/stat-prefetch/src/stat-prefetch.c b/xlators/performance/stat-prefetch/src/stat-prefetch.c index 8d97527d4bb..12101963d24 100644 --- a/xlators/performance/stat-prefetch/src/stat-prefetch.c +++ b/xlators/performance/stat-prefetch/src/stat-prefetch.c @@ -1582,6 +1582,7 @@ int32_t sp_link (call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc) { call_stub_t *stub = NULL; + sp_cache_t *cache = NULL; int32_t ret = 0, op_errno = -1; char can_wind = 0, need_lookup = 0, need_unwind = 1; @@ -1589,6 +1590,10 @@ sp_link (call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc) EINVAL); GF_VALIDATE_OR_GOTO_WITH_ERROR (this->name, oldloc->inode, out, op_errno, EINVAL); + GF_VALIDATE_OR_GOTO_WITH_ERROR (this->name, oldloc->parent, out, + op_errno, EINVAL); + GF_VALIDATE_OR_GOTO_WITH_ERROR (this->name, oldloc->name, out, + op_errno, EINVAL); GF_VALIDATE_OR_GOTO_WITH_ERROR (this->name, newloc, out, op_errno, @@ -1607,6 +1612,11 @@ sp_link (call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc) goto out; } + cache = sp_get_cache_inode (this, oldloc->parent, frame->root->pid); + if (cache) { + sp_cache_remove_entry (cache, (char *)oldloc->name, 0); + } + stub = fop_link_stub (frame, sp_link_helper, oldloc, newloc); if (stub == NULL) { op_errno = ENOMEM; |