summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/subvolume_types.h
blob: 2d2e66a4e4681ee5ba6ba18666d135ab961a2cbf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _BCACHEFS_SUBVOLUME_TYPES_H
#define _BCACHEFS_SUBVOLUME_TYPES_H

#include "darray.h"

typedef DARRAY(u32) snapshot_id_list;

#define IS_ANCESTOR_BITMAP	128

struct snapshot_t {
	u32			parent;
	u32			skip[3];
	u32			depth;
	u32			children[2];
	u32			subvol; /* Nonzero only if a subvolume points to this node: */
	u32			tree;
	u32			equiv;
	unsigned long		is_ancestor[BITS_TO_LONGS(IS_ANCESTOR_BITMAP)];
};

struct snapshot_table {
	DECLARE_FLEX_ARRAY(struct snapshot_t, s);
};

typedef struct {
	u32		subvol;
	u64		inum;
} subvol_inum;

#endif /* _BCACHEFS_SUBVOLUME_TYPES_H */