// TODO add copyright #ifndef _S3_LOCAL_ #define _S3_LOCAL_ #ifdef _S3_DEVEL_ #include #include #include #define BTRFS_FIRST_FREE_OBJECTID 256ULL #define BTRFS_LAST_FREE_OBJECTID -256ULL /* * root backrefs tie subvols and snapshots to the directory entries that * reference them */ #define S3_ROOT_BACKREF_KEY 144 /* * root refs make a fast index for listing all of the snapshots and * subvolumes referenced by a given root. They point directly to the * directory item in the root that references the subvol */ #define S3_ROOT_REF_KEY 156 /* * root items point to tree roots. There are typically in the root * tree used by the super block to find all the other trees */ #define S3_ROOT_ITEM_KEY 132 /* * this is used for both forward and backward root refs */ struct btrfs_root_ref { __le64 dirid; __le64 sequence; __le16 name_len; } __attribute__ ((__packed__)); #define S3_SETGET_STACK_FUNCS(name, type, member, bits) \ static inline uint##bits##_t btrfs_##name(const type *s) \ { \ return __le##bits##_to_cpu(s->member); \ } \ static inline void btrfs_set_##name(type *s, uint##bits##_t val) \ { \ s->member = __cpu_to_le##bits(val); \ } S3_SETGET_STACK_FUNCS(stack_root_ref_name_len, struct btrfs_root_ref, name_len, 16); #endif // _S3_DEVEL_ #endif // _S3_LOCAL_