From c7f7f134a7e2ee14d07d16d96c7849c6fd310693 Mon Sep 17 00:00:00 2001 From: Jeff Darcy Date: Tue, 16 Oct 2012 14:21:17 -0400 Subject: core: add STACK_WIND_TAIL for more efficient default_xxx. Change-Id: Ic38e2183d1320bb17c014aca33779471c8db5d5f BUG: 867132 Signed-off-by: Jeff Darcy Reviewed-on: http://review.gluster.org/4092 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- libglusterfs/src/stack.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'libglusterfs/src/stack.h') diff --git a/libglusterfs/src/stack.h b/libglusterfs/src/stack.h index 63307192ae5..b14b08dbb9a 100644 --- a/libglusterfs/src/stack.h +++ b/libglusterfs/src/stack.h @@ -254,6 +254,20 @@ STACK_RESET (call_stack_t *stack) } while (0) +/* make a call without switching frames */ +#define STACK_WIND_TAIL(frame, obj, fn, params ...) \ + do { \ + xlator_t *old_THIS = NULL; \ + \ + frame->this = obj; \ + frame->wind_to = #fn; \ + old_THIS = THIS; \ + THIS = obj; \ + fn (frame, obj, params); \ + THIS = old_THIS; \ + } while (0) + + /* make a call with a cookie */ #define STACK_WIND_COOKIE(frame, rfn, cky, obj, fn, params ...) \ do { \ -- cgit