diff options
Diffstat (limited to 'xlators/performance/stat-prefetch/src/stat-prefetch.c')
-rw-r--r-- | xlators/performance/stat-prefetch/src/stat-prefetch.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/xlators/performance/stat-prefetch/src/stat-prefetch.c b/xlators/performance/stat-prefetch/src/stat-prefetch.c index 78de50159f0..961b74f330d 100644 --- a/xlators/performance/stat-prefetch/src/stat-prefetch.c +++ b/xlators/performance/stat-prefetch/src/stat-prefetch.c @@ -630,6 +630,8 @@ sp_readdir (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, { sp_cache_t *cache = NULL; sp_local_t *local = NULL; + char *path = NULL; + int32_t ret = -1; cache = sp_get_cache_fd (this, fd); if (cache) { @@ -641,6 +643,17 @@ sp_readdir (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, } } + ret = inode_path (fd->inode, NULL, &path); + if (ret == -1) { + goto unwind; + } + + ret = sp_cache_remove_parent_entry (frame, this, path); + if (ret < 0) { + errno = -ret; + goto unwind; + } + local = CALLOC (1, sizeof (*local)); if (local) { local->fd = fd; @@ -651,6 +664,10 @@ sp_readdir (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, FIRST_CHILD(this)->fops->readdir, fd, size, off); return 0; + +unwind: + SP_STACK_UNWIND (frame, -1, errno, NULL); + return 0; } |