stack_record
struct stack_record *__stack_depot_get_stack_record(depot_stack_handle_t handle);
static struct stack_record *depot_pop_free_pool(void **prealloc, size_t size)
struct stack_record *stack;
static struct stack_record *depot_pop_free(void)
struct stack_record *stack;
stack = list_first_entry(&free_stacks, struct stack_record, free_list);
static inline size_t depot_stack_record_size(struct stack_record *s, unsigned int nr_entries)
return ALIGN(sizeof(struct stack_record) - unused, 1 << DEPOT_STACK_ALIGN);
static struct stack_record *
struct stack_record *stack = NULL;
static struct stack_record *depot_fetch_stack(depot_stack_handle_t handle)
struct stack_record *stack;
static void depot_free_stack(struct stack_record *stack)
static inline struct stack_record *find_stack(struct list_head *bucket,
struct stack_record *stack, *ret = NULL;
struct stack_record *found = NULL;
struct stack_record *new =
struct stack_record *__stack_depot_get_stack_record(depot_stack_handle_t handle)
struct stack_record *stack;
struct stack_record *stack;
dummy_stack.stack_record = __stack_depot_get_stack_record(dummy_handle);
failure_stack.stack_record = __stack_depot_get_stack_record(failure_handle);
if (dummy_stack.stack_record)
refcount_set(&dummy_stack.stack_record->count, 1);
if (failure_stack.stack_record)
refcount_set(&failure_stack.stack_record->count, 1);
static void add_stack_record_to_list(struct stack_record *stack_record,
stack->stack_record = stack_record;
struct stack_record *stack_record = __stack_depot_get_stack_record(handle);
if (!stack_record)
if (refcount_read(&stack_record->count) == REFCOUNT_SATURATED) {
if (atomic_try_cmpxchg_relaxed(&stack_record->count.refs, &old, 1))
add_stack_record_to_list(stack_record, gfp_mask);
refcount_add(nr_base_pages, &stack_record->count);
struct stack_record *stack_record = __stack_depot_get_stack_record(handle);
if (!stack_record)
if (refcount_sub_and_test(nr_base_pages, &stack_record->count))
struct stack_record *stack_record;
struct stack_record *stack_record = stack->stack_record;
if (!stack->stack_record)
nr_base_pages = refcount_read(&stack_record->count) - 1;
nr_entries = stack_record->size;
entries = stack_record->entries;
seq_printf(m, "handle: %d\n", stack_record->handle.handle);