summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2009-08-23 22:36:57 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-09-08 01:42:54 -0700
commit1d8f96e8c88b698a6cd1ec1f1a54f1b8aef70504 (patch)
tree2bf4cf002704e6f5892cc8f2190a698b53fe0927
parent5e89bf62f8fb7a2a863f8b0c08ee1815a5aa5b38 (diff)
performance/stat-prefetch: implement sp_fxattrop.
.../performance/stat-prefetch/src/stat-prefetch.c | 37 ++++++++++++++++++++ 1 files changed, 37 insertions(+), 0 deletions(-) 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.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/xlators/performance/stat-prefetch/src/stat-prefetch.c b/xlators/performance/stat-prefetch/src/stat-prefetch.c
index 41608e4b578..6bbedf08c0e 100644
--- a/xlators/performance/stat-prefetch/src/stat-prefetch.c
+++ b/xlators/performance/stat-prefetch/src/stat-prefetch.c
@@ -1704,6 +1704,42 @@ unwind:
int32_t
+sp_fxattrop (call_frame_t *frame, xlator_t *this, fd_t *fd,
+ gf_xattrop_flags_t flags, dict_t *dict)
+{
+ sp_fd_ctx_t *fd_ctx = NULL;
+ sp_cache_t *cache = NULL;
+ uint64_t value = 0;
+ int32_t ret = 0;
+ inode_t *parent = NULL;
+ char *name = NULL;
+
+ ret = fd_ctx_get (fd, this, &value);
+ if (ret == -1) {
+ errno = EINVAL;
+ goto unwind;
+ }
+
+ fd_ctx = (void *)(long)value;
+ name = fd_ctx->name;
+ parent = fd_ctx->parent_inode;
+
+ cache = sp_get_cache_inode (this, parent, frame->root->pid);
+ if (cache) {
+ sp_cache_remove_entry (cache, name, 0);
+ }
+
+ STACK_WIND (frame, sp_xattrop_cbk, FIRST_CHILD(this),
+ FIRST_CHILD(this)->fops->fxattrop, fd, 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;
@@ -1774,6 +1810,7 @@ struct xlator_fops fops = {
.getdents = sp_getdents,
.checksum = sp_checksum,
.xattrop = sp_xattrop,
+ .fxattrop = sp_fxattrop,
};
struct xlator_mops mops = {