linux/lib/generic-radix-tree.c


#include <linux/atomic.h>
#include <linux/export.h>
#include <linux/generic-radix-tree.h>
#include <linux/gfp.h>
#include <linux/kmemleak.h>

#define GENRADIX_ARY
#define GENRADIX_ARY_SHIFT

struct genradix_node {};

static inline int genradix_depth_shift(unsigned depth)
{}

/*
 * Returns size (of data, in bytes) that a tree of a given depth holds:
 */
static inline size_t genradix_depth_size(unsigned depth)
{}

/* depth that's needed for a genradix that can address up to ULONG_MAX: */
#define GENRADIX_MAX_DEPTH

#define GENRADIX_DEPTH_MASK

static inline unsigned genradix_root_to_depth(struct genradix_root *r)
{}

static inline struct genradix_node *genradix_root_to_node(struct genradix_root *r)
{}

/*
 * Returns pointer to the specified byte @offset within @radix, or NULL if not
 * allocated
 */
void *__genradix_ptr(struct __genradix *radix, size_t offset)
{}
EXPORT_SYMBOL();

static inline struct genradix_node *genradix_alloc_node(gfp_t gfp_mask)
{}

static inline void genradix_free_node(struct genradix_node *node)
{}

/*
 * Returns pointer to the specified byte @offset within @radix, allocating it if
 * necessary - newly allocated slots are always zeroed out:
 */
void *__genradix_ptr_alloc(struct __genradix *radix, size_t offset,
			   gfp_t gfp_mask)
{}
EXPORT_SYMBOL();

void *__genradix_iter_peek(struct genradix_iter *iter,
			   struct __genradix *radix,
			   size_t objs_per_page)
{}
EXPORT_SYMBOL();

void *__genradix_iter_peek_prev(struct genradix_iter *iter,
				struct __genradix *radix,
				size_t objs_per_page,
				size_t obj_size_plus_page_remainder)
{}
EXPORT_SYMBOL();

static void genradix_free_recurse(struct genradix_node *n, unsigned level)
{}

int __genradix_prealloc(struct __genradix *radix, size_t size,
			gfp_t gfp_mask)
{}
EXPORT_SYMBOL();

void __genradix_free(struct __genradix *radix)
{}
EXPORT_SYMBOL();