2021-10-28 23:27:01 +03:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
#ifndef _BCACHEFS_SUBVOLUME_TYPES_H
|
|
|
|
#define _BCACHEFS_SUBVOLUME_TYPES_H
|
|
|
|
|
2024-03-17 02:29:22 +03:00
|
|
|
#include "darray.h"
|
2022-03-31 00:40:25 +03:00
|
|
|
|
|
|
|
typedef DARRAY(u32) snapshot_id_list;
|
2021-10-28 23:27:01 +03:00
|
|
|
|
2023-07-21 01:09:44 +03:00
|
|
|
#define IS_ANCESTOR_BITMAP 128
|
|
|
|
|
2023-03-31 22:52:24 +03:00
|
|
|
struct snapshot_t {
|
|
|
|
u32 parent;
|
2023-07-10 21:17:18 +03:00
|
|
|
u32 skip[3];
|
|
|
|
u32 depth;
|
2023-03-31 22:52:24 +03:00
|
|
|
u32 children[2];
|
|
|
|
u32 subvol; /* Nonzero only if a subvolume points to this node: */
|
2023-04-26 23:34:57 +03:00
|
|
|
u32 tree;
|
2023-03-31 22:52:24 +03:00
|
|
|
u32 equiv;
|
2023-07-21 01:09:44 +03:00
|
|
|
unsigned long is_ancestor[BITS_TO_LONGS(IS_ANCESTOR_BITMAP)];
|
2023-03-31 22:52:24 +03:00
|
|
|
};
|
|
|
|
|
2023-07-11 03:31:34 +03:00
|
|
|
struct snapshot_table {
|
2024-03-30 05:09:24 +03:00
|
|
|
struct rcu_head rcu;
|
|
|
|
size_t nr;
|
2023-12-22 03:49:00 +03:00
|
|
|
#ifndef RUST_BINDGEN
|
2023-11-13 04:53:57 +03:00
|
|
|
DECLARE_FLEX_ARRAY(struct snapshot_t, s);
|
2023-12-22 03:49:00 +03:00
|
|
|
#else
|
|
|
|
struct snapshot_t s[0];
|
|
|
|
#endif
|
2023-07-11 03:31:34 +03:00
|
|
|
};
|
|
|
|
|
2023-03-31 22:52:24 +03:00
|
|
|
typedef struct {
|
|
|
|
u32 subvol;
|
|
|
|
u64 inum;
|
|
|
|
} subvol_inum;
|
|
|
|
|
2021-10-28 23:27:01 +03:00
|
|
|
#endif /* _BCACHEFS_SUBVOLUME_TYPES_H */
|