linux/fs/bcachefs/darray.h

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _BCACHEFS_DARRAY_H
#define _BCACHEFS_DARRAY_H

/*
 * Dynamic arrays:
 *
 * Inspired by CCAN's darray
 */

#include <linux/slab.h>

#define DARRAY_PREALLOCATED(_type, _nr)

#define DARRAY(_type)

darray_char;
darray_str;

int __bch2_darray_resize(darray_char *, size_t, size_t, gfp_t);

static inline int __darray_resize(darray_char *d, size_t element_size,
				  size_t new_size, gfp_t gfp)
{}

#define darray_resize_gfp(_d, _new_size, _gfp)

#define darray_resize(_d, _new_size)

static inline int __darray_make_room(darray_char *d, size_t t_size, size_t more, gfp_t gfp)
{}

#define darray_make_room_gfp(_d, _more, _gfp)

#define darray_make_room(_d, _more)

#define darray_room(_d)

#define darray_top(_d)

#define darray_push_gfp(_d, _item, _gfp)

#define darray_push(_d, _item)

#define darray_pop(_d)

#define darray_first(_d)
#define darray_last(_d)

#define darray_insert_item(_d, pos, _item)

#define darray_remove_item(_d, _pos)

#define __darray_for_each(_d, _i)

#define darray_for_each(_d, _i)

#define darray_for_each_reverse(_d, _i)

#define darray_init(_d)

#define darray_exit(_d)

#endif /* _BCACHEFS_DARRAY_H */