summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2009-08-23 22:28:55 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-09-08 01:41:04 -0700
commit3a0317982bfc8c507cfaf8dc919d5f4bab4371f7 (patch)
tree8d8c99c36038175337bb81863dac052c725098eb /xlators
parent517c1997f5cb1ee7b62cc925f943b33e91e7b974 (diff)
performance/stat-prefetch: implement sp_chmod.
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.c34
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 0619545b790..a6a864f9472 100644
--- a/xlators/performance/stat-prefetch/src/stat-prefetch.c
+++ b/xlators/performance/stat-prefetch/src/stat-prefetch.c
@@ -448,6 +448,39 @@ sp_readdir (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
int32_t
+sp_stbuf_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret,
+ int32_t op_errno, struct stat *buf)
+{
+ SP_STACK_UNWIND (frame, op_ret, op_errno, buf);
+ return 0;
+}
+
+
+int32_t
+sp_chmod (call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode)
+{
+ 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_stbuf_cbk, FIRST_CHILD(this),
+ FIRST_CHILD(this)->fops->chmod, loc, mode);
+ 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;
@@ -491,6 +524,7 @@ fini (xlator_t *this)
struct xlator_fops fops = {
.lookup = sp_lookup,
.readdir = sp_readdir,
+ .chmod = sp_chmod,
};
struct xlator_mops mops = {