From b19719d037f32a5af109bc474afda2230a0a2403 Mon Sep 17 00:00:00 2001 From: Shylesh Kumar Date: Thu, 16 Feb 2012 11:06:08 +0530 Subject: filter stripe internal xattrs from getxattr call Change-Id: Ia0e9662644494c61033e7a7853353294598984af BUG: 787964 Signed-off-by: Shylesh Kumar Reviewed-on: http://review.gluster.com/2758 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi Reviewed-by: Vijay Bellur --- xlators/cluster/stripe/src/stripe.c | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'xlators/cluster/stripe/src/stripe.c') diff --git a/xlators/cluster/stripe/src/stripe.c b/xlators/cluster/stripe/src/stripe.c index 9c86060c3..5e369d64b 100644 --- a/xlators/cluster/stripe/src/stripe.c +++ b/xlators/cluster/stripe/src/stripe.c @@ -4450,6 +4450,35 @@ stripe_getxattr_unwind (call_frame_t *frame, return 0; } +int +stripe_internal_getxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + int op_ret, int op_errno, dict_t *xattr) +{ + + char size_key[256] = {0,}; + char index_key[256] = {0,}; + char count_key[256] = {0,}; + + VALIDATE_OR_GOTO (frame, out); + VALIDATE_OR_GOTO (frame->local, out); + + if (!xattr || (op_ret == -1)) + goto out; + + sprintf (size_key, "trusted.%s.stripe-size", this->name); + sprintf (count_key, "trusted.%s.stripe-count", this->name); + sprintf (index_key, "trusted.%s.stripe-index", this->name); + + dict_del (xattr, size_key); + dict_del (xattr, count_key); + dict_del (xattr, index_key); + +out: + STRIPE_STACK_UNWIND (getxattr, frame, op_ret, op_errno, xattr); + + return 0; + +} int stripe_getxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, @@ -4770,7 +4799,7 @@ stripe_getxattr (call_frame_t *frame, xlator_t *this, } - STACK_WIND (frame, default_getxattr_cbk, FIRST_CHILD(this), + STACK_WIND (frame, stripe_internal_getxattr_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->getxattr, loc, name); return 0; -- cgit