summaryrefslogtreecommitdiffstats
path: root/xlators/performance/stat-prefetch/src/stat-prefetch.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/performance/stat-prefetch/src/stat-prefetch.c')
-rw-r--r--xlators/performance/stat-prefetch/src/stat-prefetch.c36
1 files changed, 23 insertions, 13 deletions
diff --git a/xlators/performance/stat-prefetch/src/stat-prefetch.c b/xlators/performance/stat-prefetch/src/stat-prefetch.c
index 6c81e8a3c..11821eb8a 100644
--- a/xlators/performance/stat-prefetch/src/stat-prefetch.c
+++ b/xlators/performance/stat-prefetch/src/stat-prefetch.c
@@ -589,7 +589,8 @@ out:
int32_t
-sp_cache_remove_parent_entry (call_frame_t *frame, xlator_t *this, char *path)
+sp_cache_remove_parent_entry (call_frame_t *frame, xlator_t *this,
+ inode_table_t *itable, char *path)
{
char *parent = NULL, *grand_parent = NULL, *cpy = NULL;
inode_t *inode_gp = NULL;
@@ -603,8 +604,7 @@ sp_cache_remove_parent_entry (call_frame_t *frame, xlator_t *this, char *path)
}
if (grand_parent && strcmp (grand_parent, "/")) {
- inode_gp = inode_from_path (frame->root->frames.this->itable,
- grand_parent);
+ inode_gp = inode_from_path (itable, grand_parent);
if (inode_gp) {
cache_gp = sp_get_cache_inode (this, inode_gp,
frame->root->pid);
@@ -985,7 +985,8 @@ sp_readdir (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
goto unwind;
}
- ret = sp_cache_remove_parent_entry (frame, this, path);
+ ret = sp_cache_remove_parent_entry (frame, this, fd->inode->table,
+ path);
if (ret < 0) {
errno = -ret;
goto unwind;
@@ -1325,7 +1326,8 @@ sp_create (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
GF_VALIDATE_OR_GOTO_WITH_ERROR (this->name, loc->inode, out,
op_errno, EINVAL);
- ret = sp_cache_remove_parent_entry (frame, this, (char *)loc->path);
+ ret = sp_cache_remove_parent_entry (frame, this, loc->parent->table,
+ (char *)loc->path);
if (ret == -1) {
op_errno = errno;
gf_log (this->name, GF_LOG_ERROR, "%s", strerror (op_errno));
@@ -1544,7 +1546,8 @@ sp_mkdir (call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode)
GF_VALIDATE_OR_GOTO_WITH_ERROR (this->name, loc->inode, out,
op_errno, EINVAL);
- ret = sp_cache_remove_parent_entry (frame, this, (char *)loc->path);
+ ret = sp_cache_remove_parent_entry (frame, this, loc->parent->table,
+ (char *)loc->path);
if (ret == -1) {
op_errno = errno;
gf_log (this->name, GF_LOG_ERROR, "%s", strerror (op_errno));
@@ -1642,7 +1645,8 @@ sp_mknod (call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
GF_VALIDATE_OR_GOTO_WITH_ERROR (this->name, loc->inode, out,
op_errno, EINVAL);
- ret = sp_cache_remove_parent_entry (frame, this, (char *)loc->path);
+ ret = sp_cache_remove_parent_entry (frame, this, loc->parent->table,
+ (char *)loc->path);
if (ret == -1) {
op_errno = errno;
gf_log (this->name, GF_LOG_ERROR, "%s", strerror (errno));
@@ -1739,7 +1743,8 @@ sp_symlink (call_frame_t *frame, xlator_t *this, const char *linkpath,
GF_VALIDATE_OR_GOTO_WITH_ERROR (this->name, loc->inode, out,
op_errno, EINVAL);
- ret = sp_cache_remove_parent_entry (frame, this, (char *)loc->path);
+ ret = sp_cache_remove_parent_entry (frame, this, loc->parent->table,
+ (char *)loc->path);
if (ret == -1) {
op_errno = errno;
gf_log (this->name, GF_LOG_ERROR, "%s", strerror (op_errno));
@@ -1840,7 +1845,8 @@ sp_link (call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc)
GF_VALIDATE_OR_GOTO_WITH_ERROR (this->name, newloc->name, out,
op_errno, EINVAL);
- ret = sp_cache_remove_parent_entry (frame, this, (char *)newloc->path);
+ ret = sp_cache_remove_parent_entry (frame, this, newloc->parent->table,
+ (char *)newloc->path);
if (ret == -1) {
op_errno = errno;
gf_log (this->name, GF_LOG_ERROR, "%s", strerror (op_errno));
@@ -2439,7 +2445,8 @@ sp_unlink (call_frame_t *frame, xlator_t *this, loc_t *loc)
sp_cache_unref (cache);
}
- ret = sp_cache_remove_parent_entry (frame, this, (char *)loc->path);
+ ret = sp_cache_remove_parent_entry (frame, this, loc->inode->table,
+ (char *)loc->path);
if (ret == -1) {
op_errno = errno;
gf_log (this->name, GF_LOG_ERROR, "%s", strerror (op_errno));
@@ -2559,7 +2566,8 @@ sp_rmdir (call_frame_t *frame, xlator_t *this, loc_t *loc)
sp_cache_unref (cache);
}
- ret = sp_cache_remove_parent_entry (frame, this, (char *)loc->path);
+ ret = sp_cache_remove_parent_entry (frame, this, loc->inode->table,
+ (char *)loc->path);
if (ret == -1) {
op_errno = errno;
gf_log (this->name, GF_LOG_ERROR, "%s", strerror (op_errno));
@@ -2845,14 +2853,16 @@ sp_rename (call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc)
sp_cache_unref (cache);
}
- ret = sp_cache_remove_parent_entry (frame, this, (char *)oldloc->path);
+ ret = sp_cache_remove_parent_entry (frame, this, oldloc->parent->table,
+ (char *)oldloc->path);
if (ret == -1) {
op_errno = errno;
gf_log (this->name, GF_LOG_ERROR, "%s", strerror (op_errno));
goto out;
}
- ret = sp_cache_remove_parent_entry (frame, this, (char *)newloc->path);
+ ret = sp_cache_remove_parent_entry (frame, this, newloc->parent->table,
+ (char *)newloc->path);
if (ret == -1) {
op_errno = errno;
gf_log (this->name, GF_LOG_ERROR, "%s", strerror (op_errno));