From a3449caf58d7e4876cf0246e22b044a8de8bde2b Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Sun, 23 Aug 2009 22:35:52 +0000 Subject: performance/stat-prefetch: implement sp_setxattr. Signed-off-by: Anand V. Avati BUG: 221 (stat prefetch implementation) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=221 --- .../performance/stat-prefetch/src/stat-prefetch.c | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/xlators/performance/stat-prefetch/src/stat-prefetch.c b/xlators/performance/stat-prefetch/src/stat-prefetch.c index c364fa77c56..3d866b55ebe 100644 --- a/xlators/performance/stat-prefetch/src/stat-prefetch.c +++ b/xlators/performance/stat-prefetch/src/stat-prefetch.c @@ -1442,6 +1442,31 @@ unwind: } +int32_t +sp_setxattr (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, + int32_t flags) +{ + 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_err_cbk, FIRST_CHILD(this), + FIRST_CHILD(this)->fops->setxattr, loc, dict, flags); + return 0; + +unwind: + SP_STACK_UNWIND (frame, -1, errno); + return 0; +} + + int32_t sp_forget (xlator_t *this, inode_t *inode) { @@ -1507,6 +1532,7 @@ struct xlator_fops fops = { .writev = sp_writev, .fsync = sp_fsync, .rename = sp_rename, + .setxattr = sp_setxattr, }; struct xlator_mops mops = { -- cgit