From b4218f679113b3b0a6e08a0dd9482ec99ee77a38 Mon Sep 17 00:00:00 2001 From: shishir gowda Date: Mon, 13 Dec 2010 13:40:34 +0000 Subject: Implement STRIPE_STACK_UNWIND and STRIPE_STACK_DESTROY Signed-off-by: shishir gowda Signed-off-by: Anand V. Avati BUG: 2134 (inode leaks on stripe) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2134 --- xlators/cluster/stripe/src/stripe.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'xlators') diff --git a/xlators/cluster/stripe/src/stripe.h b/xlators/cluster/stripe/src/stripe.h index d94d82d6dc9..3dbd93d59f6 100644 --- a/xlators/cluster/stripe/src/stripe.h +++ b/xlators/cluster/stripe/src/stripe.h @@ -37,6 +37,24 @@ #include +#define STRIPE_STACK_UNWIND(fop, frame, params ...) do { \ + stripe_local_t *__local = NULL; \ + if (frame) { \ + __local = frame->local; \ + frame->local = NULL; \ + } \ + STACK_UNWIND_STRICT (fop, frame, params); \ + stripe_local_wipe(__local); \ + } while (0) + +#define STRIPE_STACK_DESTROY(frame) do { \ + stripe_local_t *__local = NULL; \ + __local = frame->local; \ + frame->local = NULL; \ + STACK_DESTROY (frame->root); \ + stripe_local_wipe (__local); \ + } while (0) + /** * struct stripe_options : This keeps the pattern and the block-size * information, which is used for striping on a file. -- cgit