From 5e89bf62f8fb7a2a863f8b0c08ee1815a5aa5b38 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Sun, 23 Aug 2009 22:36:47 +0000 Subject: performance/stat-prefetch: implement sp_xattrop. 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 | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'xlators') 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 @@ -1669,6 +1669,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) { @@ -1739,6 +1773,7 @@ struct xlator_fops fops = { .setdents = sp_setdents, .getdents = sp_getdents, .checksum = sp_checksum, + .xattrop = sp_xattrop, }; struct xlator_mops mops = { -- cgit