diff options
Diffstat (limited to 'libglusterfs/src/stack.h')
-rw-r--r-- | libglusterfs/src/stack.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/libglusterfs/src/stack.h b/libglusterfs/src/stack.h index 220eab49d0e..a18ca6deb89 100644 --- a/libglusterfs/src/stack.h +++ b/libglusterfs/src/stack.h @@ -177,6 +177,7 @@ STACK_DESTROY (call_stack_t *stack) } LOCK_DESTROY (&stack->frames.lock); + LOCK_DESTROY (&stack->stack_lock); while (stack->frames.next) { FRAME_DESTROY (stack->frames.next); @@ -187,6 +188,23 @@ STACK_DESTROY (call_stack_t *stack) mem_put (local); } +static inline void +STACK_RESET (call_stack_t *stack) +{ + void *local = NULL; + + if (stack->frames.local) { + local = stack->frames.local; + stack->frames.local = NULL; + } + + while (stack->frames.next) { + FRAME_DESTROY (stack->frames.next); + } + + if (local) + mem_put (local); +} #define cbk(x) cbk_##x |