X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libbcachefs%2Fsubvolume_types.h;h=86833445af205643b81bd08b3b204005c7bee071;hb=bd9e0153342c51390ec655b4e78eda1aa1c32a84;hp=9410b9587591e8c479765c911b3a586e5a6d0bef;hpb=6f8750c30eabbd5ccd87e10fc5f0d94278ed95c8;p=bcachefs-tools-debian diff --git a/libbcachefs/subvolume_types.h b/libbcachefs/subvolume_types.h index 9410b95..8683344 100644 --- a/libbcachefs/subvolume_types.h +++ b/libbcachefs/subvolume_types.h @@ -2,10 +2,30 @@ #ifndef _BCACHEFS_SUBVOLUME_TYPES_H #define _BCACHEFS_SUBVOLUME_TYPES_H -struct snapshot_id_list { - u32 nr; - u32 size; - u32 *d; +#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 { + struct snapshot_t s[0]; +}; + +typedef struct { + u32 subvol; + u64 inum; +} subvol_inum; + #endif /* _BCACHEFS_SUBVOLUME_TYPES_H */