diff options
author | Shylesh Kumar <shylesh@gluster.com> | 2012-02-16 11:06:08 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2012-02-16 21:30:50 -0800 |
commit | b19719d037f32a5af109bc474afda2230a0a2403 (patch) | |
tree | 0bc8add25df19e12c62b43bd0579953066e1bd24 /xlators/cluster/stripe | |
parent | 26800453aacd76e6edc36c078aaacbe7c16aa75e (diff) |
filter stripe internal xattrs from getxattr call
Change-Id: Ia0e9662644494c61033e7a7853353294598984af
BUG: 787964
Signed-off-by: Shylesh Kumar <shylesh@gluster.com>
Reviewed-on: http://review.gluster.com/2758
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/cluster/stripe')
-rw-r--r-- | xlators/cluster/stripe/src/stripe.c | 31 |
1 files changed, 30 insertions, 1 deletions
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; |