36 lines · c
1/* SPDX-License-Identifier: GPL-2.0 */2#ifndef _BCACHEFS_SUBVOLUME_FORMAT_H3#define _BCACHEFS_SUBVOLUME_FORMAT_H4 5#define SUBVOL_POS_MIN POS(0, 1)6#define SUBVOL_POS_MAX POS(0, S32_MAX)7#define BCACHEFS_ROOT_SUBVOL 18 9struct bch_subvolume {10 struct bch_val v;11 __le32 flags;12 __le32 snapshot;13 __le64 inode;14 /*15 * Snapshot subvolumes form a tree, separate from the snapshot nodes16 * tree - if this subvolume is a snapshot, this is the ID of the17 * subvolume it was created from:18 *19 * This is _not_ necessarily the subvolume of the directory containing20 * this subvolume:21 */22 __le32 creation_parent;23 __le32 fs_path_parent;24 bch_le128 otime;25};26 27LE32_BITMASK(BCH_SUBVOLUME_RO, struct bch_subvolume, flags, 0, 1)28/*29 * We need to know whether a subvolume is a snapshot so we can know whether we30 * can delete it (or whether it should just be rm -rf'd)31 */32LE32_BITMASK(BCH_SUBVOLUME_SNAP, struct bch_subvolume, flags, 1, 2)33LE32_BITMASK(BCH_SUBVOLUME_UNLINKED, struct bch_subvolume, flags, 2, 3)34 35#endif /* _BCACHEFS_SUBVOLUME_FORMAT_H */36