1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _BCACHEFS_SUBVOLUME_FORMAT_H
3 #define _BCACHEFS_SUBVOLUME_FORMAT_H
5 #define SUBVOL_POS_MIN POS(0, 1)
6 #define SUBVOL_POS_MAX POS(0, S32_MAX)
7 #define BCACHEFS_ROOT_SUBVOL 1
15 * Snapshot subvolumes form a tree, separate from the snapshot nodes
16 * tree - if this subvolume is a snapshot, this is the ID of the
17 * subvolume it was created from:
19 * This is _not_ necessarily the subvolume of the directory containing
22 __le32 creation_parent
;
23 __le32 fs_path_parent
;
27 LE32_BITMASK(BCH_SUBVOLUME_RO
, struct bch_subvolume
, flags
, 0, 1)
29 * We need to know whether a subvolume is a snapshot so we can know whether we
30 * can delete it (or whether it should just be rm -rf'd)
32 LE32_BITMASK(BCH_SUBVOLUME_SNAP
, struct bch_subvolume
, flags
, 1, 2)
33 LE32_BITMASK(BCH_SUBVOLUME_UNLINKED
, struct bch_subvolume
, flags
, 2, 3)
35 #endif /* _BCACHEFS_SUBVOLUME_FORMAT_H */