diff options
author | Raghavendra G <raghavendra@gluster.com> | 2009-08-23 22:36:47 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-09-08 01:42:50 -0700 |
commit | 5e89bf62f8fb7a2a863f8b0c08ee1815a5aa5b38 (patch) | |
tree | 0efde0eb7cea5b2a8656179612daa73d939f5385 /xlators/performance | |
parent | 284b42546e01f81e53b45695de1b4c893c98f418 (diff) |
performance/stat-prefetch: implement sp_xattrop.
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/performance')
-rw-r--r-- | xlators/performance/stat-prefetch/src/stat-prefetch.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/xlators/performance/stat-prefetch/src/stat-prefetch.c b/xlators/performance/stat-prefetch/src/stat-prefetch.c index 025176e75..41608e4b5 100644 --- a/xlators/performance/stat-prefetch/src/stat-prefetch.c +++ b/xlators/performance/stat-prefetch/src/stat-prefetch.c @@ -1670,6 +1670,40 @@ unwind: int32_t +sp_xattrop_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + int32_t op_ret, int32_t op_errno, dict_t *dict) +{ + SP_STACK_UNWIND (frame, op_ret, op_errno, dict); + return 0; +} + + +int32_t +sp_xattrop (call_frame_t *frame, xlator_t *this, loc_t *loc, + gf_xattrop_flags_t flags, dict_t *dict) +{ + 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_xattrop_cbk, FIRST_CHILD(this), + FIRST_CHILD(this)->fops->xattrop, loc, flags, dict); + 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; @@ -1739,6 +1773,7 @@ struct xlator_fops fops = { .setdents = sp_setdents, .getdents = sp_getdents, .checksum = sp_checksum, + .xattrop = sp_xattrop, }; struct xlator_mops mops = { |