]> git.sesse.net Git - bcachefs-tools-debian/blob - include/linux/darray_types.h
Update bcachefs sources to 50847e296b34 bcachefs: Check subvol <-> inode pointers...
[bcachefs-tools-debian] / include / linux / darray_types.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * (C) 2022-2024 Kent Overstreet <kent.overstreet@linux.dev>
4  */
5 #ifndef _LINUX_DARRAY_TYpES_H
6 #define _LINUX_DARRAY_TYpES_H
7
8 #include <linux/types.h>
9
10 #define DARRAY_PREALLOCATED(_type, _nr)                                 \
11 struct {                                                                \
12         size_t nr, size;                                                \
13         _type *data;                                                    \
14         _type preallocated[_nr];                                        \
15 }
16
17 #define DARRAY(_type) DARRAY_PREALLOCATED(_type, 0)
18
19 typedef DARRAY(char)    darray_char;
20 typedef DARRAY(char *)  darray_str;
21
22 #endif /* _LINUX_DARRAY_TYpES_H */