diff options
author | Raghavendra G <raghavendra@gluster.com> | 2009-08-23 22:31:37 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-09-08 01:42:04 -0700 |
commit | 22ec7a4cb2e05f2c3c4512d80256008caa8b994b (patch) | |
tree | 15d402c1a0308c04fe765180cc3ae621635e3988 /xlators | |
parent | 4538285776eeaa5383d7473438440d953fd9e232 (diff) |
performance/stat-prefetch: implement sp_readlink.
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.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/xlators/performance/stat-prefetch/src/stat-prefetch.c b/xlators/performance/stat-prefetch/src/stat-prefetch.c index cdf6d73de..dd3f4942d 100644 --- a/xlators/performance/stat-prefetch/src/stat-prefetch.c +++ b/xlators/performance/stat-prefetch/src/stat-prefetch.c @@ -1144,6 +1144,39 @@ unwind: int32_t +sp_readlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + int32_t op_ret, int32_t op_errno, const char *path) +{ + SP_STACK_UNWIND (frame, op_ret, op_errno, path); + return 0; +} + + +int32_t +sp_readlink (call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size) +{ + sp_cache_t *cache = NULL; + + GF_VALIDATE_OR_GOTO (this->name, loc, unwind); + GF_VALIDATE_OR_GOTO (this->name, loc->parent, unwind); + GF_VALIDATE_OR_GOTO (this->name, loc->name, unwind); + + cache = sp_get_cache_inode (this, loc->parent, frame->root->pid); + if (cache) { + sp_cache_remove_entry (cache, (char *)loc->name, 0); + } + + STACK_WIND (frame, sp_readlink_cbk, FIRST_CHILD(this), + FIRST_CHILD(this)->fops->readlink, loc, size); + return 0; + +unwind: + SP_STACK_UNWIND (frame, -1, errno, NULL); + return 0; +} + + +int32_t sp_forget (xlator_t *this, inode_t *inode) { struct stat *buf = NULL; @@ -1201,6 +1234,7 @@ struct xlator_fops fops = { .truncate = sp_truncate, .ftruncate = sp_ftruncate, .utimens = sp_utimens, + .readlink = sp_readlink, }; struct xlator_mops mops = { |