summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2009-08-23 22:35:52 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-09-08 01:42:29 -0700
commita3449caf58d7e4876cf0246e22b044a8de8bde2b (patch)
tree747ebc093e8b378f39e357582bd67f38d848f511
parent52c34af5f4814b0b85efdc3c4d23638b6ca5514c (diff)
performance/stat-prefetch: implement sp_setxattr.
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
-rw-r--r--xlators/performance/stat-prefetch/src/stat-prefetch.c26
1 files changed, 26 insertions, 0 deletions
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
@@ -1443,6 +1443,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)
{
struct stat *buf = NULL;
@@ -1507,6 +1532,7 @@ struct xlator_fops fops = {
.writev = sp_writev,
.fsync = sp_fsync,
.rename = sp_rename,
+ .setxattr = sp_setxattr,
};
struct xlator_mops mops = {