summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2009-10-08 06:21:43 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-10-09 00:49:41 -0700
commitbbaf6e2d35841c2976855e09e3c744bc6c364821 (patch)
treeb70031a5fd761bcb38bff1d06848636704747fa6 /xlators
parent7fcb479dc329d9931c0ec975ab8b87450d6d8b24 (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: 221 (stat prefetch implementation) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=221
Diffstat (limited to 'xlators')
-rw-r--r--xlators/performance/stat-prefetch/src/stat-prefetch.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/xlators/performance/stat-prefetch/src/stat-prefetch.c b/xlators/performance/stat-prefetch/src/stat-prefetch.c
index eef56a771..81c9180be 100644
--- a/xlators/performance/stat-prefetch/src/stat-prefetch.c
+++ b/xlators/performance/stat-prefetch/src/stat-prefetch.c
@@ -1517,6 +1517,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;
@@ -1531,9 +1532,9 @@ sp_link (call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc)
GF_VALIDATE_OR_GOTO_WITH_ERROR (this->name, newloc->inode, out,
op_errno, EINVAL);
- GF_VALIDATE_OR_GOTO_WITH_ERROR (this->name, newloc, out, op_errno,
- EINVAL);
- GF_VALIDATE_OR_GOTO_WITH_ERROR (this->name, newloc->parent, out,
+ 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);
ret = sp_cache_remove_parent_entry (frame, this, (char *)newloc->path);
@@ -1543,6 +1544,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;