#!/bin/sh aclocal -I . autoheader autoconf automake --add-missing --copy --foreign GlusterFS. This file is licensed to you under your choice of the GNU Lesser General Public License, version 3 or any later version (LGPLv3 or later), or the GNU General Public License, version 2 (GPLv2), in all cases as published by the Free Software Foundation. */ /* This file defines MACROS and static inlines used to emulate a function call over asynchronous communication with remote server */ #ifndef _STACK_H #define _STACK_H struct _call_stack; typedef struct _call_stack call_stack_t; struct _call_frame; typedef struct _call_frame call_frame_t; struct call_pool; typedef struct call_pool call_pool_t; #include #include "xlator.h" #include "dict.h" #include "list.h" #include "common-utils.h" #include "lkowner.h" #include "client_t.h" #include "libglusterfs-messages.h" #include "timespec.h" #define NFS_PID 1 #define LOW_PRIO_PROC_PID -1 #define STACK_ERR_XL_NAME(stack) (stack->err_xl?stack->err_xl->name:"-") #define STACK_CLIENT_NAME(stack) (stack->client?stack->client->client_uid:"-") typedef int32_t (*ret_fn_t) (call_frame_t *frame, call_frame_t *prev_frame, xlator_t *this, int32_t op_ret, int32_t op_errno, ...); struct call_pool { union { struct list_head all_frames; struct { call_stack_t *next_call; call_stack_t *prev_call; } all_stacks; }; int64_t cnt; gf_atomic_t total_count; gf_lock_t lock; struct mem_pool *frame_mem_pool; struct mem_pool *stack_mem_pool; }; struct _call_frame { call_stack_t *root; /* stack root */ call_frame_t *parent; /* previous BP */ struct list_head frames; void *local; /* local variables */ xlator_t *this; /* implicit object */ ret_fn_t ret; /* op_return address */ int32_t ref_count; gf_lock_t lock; void *cookie; /* unique cookie */ gf_boolean_t complete; glusterfs_fop_t op; struct timespec begin; /* when this frame was created */ struct timespec end; /* when this frame completed */ const char *wind_from; const char *wind_to; const char *unwind_from; const char *unwind_to; }; #define SMALL_GROUP_COUNT 128 struct _call_stack { union { struct list_head all_frames; struct { call_stack_t *next_call; call_stack_t *prev_call; }; }; call_pool_t *pool; gf_lock_t stack_lock; client_t *client; uint64_t unique; void *state; /* pointer to request state */ uid_t uid; gid_t gid; pid_t pid; char identifier[UNIX_PATH_MAX]; uint16_t ngrps; uint32_t groups_small[SMALL_GROUP_COUNT]; uint32_t *groups_large; uint32_t *groups; gf_lkowner_t lk_owner; gl