Go to the documentation of this file.
10 #ifndef FS_LOGFS_LOGFS_ABI_H
11 #define FS_LOGFS_LOGFS_ABI_H
15 #define BUILD_BUG_ON(condition)
18 #define SIZE_CHECK(type, size) \
19 static inline void check_##type(void) \
21 BUILD_BUG_ON(sizeof(struct type) != (size)); \
64 #define LOGFS_MAGIC 0x7a3a8e5cb9d5bf67ull
65 #define LOGFS_MAGIC_U32 0xc97e8168u
77 #define LOGFS_BLOCKSIZE (4096ull)
78 #define LOGFS_BLOCK_FACTOR (LOGFS_BLOCKSIZE / sizeof(u64))
79 #define LOGFS_BLOCK_BITS (9)
85 #define I0_BLOCKS (16)
86 #define I1_BLOCKS LOGFS_BLOCK_FACTOR
87 #define I2_BLOCKS (LOGFS_BLOCK_FACTOR * I1_BLOCKS)
88 #define I3_BLOCKS (LOGFS_BLOCK_FACTOR * I2_BLOCKS)
89 #define I4_BLOCKS (LOGFS_BLOCK_FACTOR * I3_BLOCKS)
90 #define I5_BLOCKS (LOGFS_BLOCK_FACTOR * I4_BLOCKS)
92 #define INDIRECT_INDEX I0_BLOCKS
93 #define LOGFS_EMBEDDED_FIELDS (I0_BLOCKS + 1)
103 #define LOGFS_EMBEDDED_SIZE (LOGFS_EMBEDDED_FIELDS * sizeof(u64))
104 #define LOGFS_I0_SIZE (I0_BLOCKS * LOGFS_BLOCKSIZE)
105 #define LOGFS_I1_SIZE (I1_BLOCKS * LOGFS_BLOCKSIZE)
106 #define LOGFS_I2_SIZE (I2_BLOCKS * LOGFS_BLOCKSIZE)
107 #define LOGFS_I3_SIZE (I3_BLOCKS * LOGFS_BLOCKSIZE)
108 #define LOGFS_I4_SIZE (I4_BLOCKS * LOGFS_BLOCKSIZE)
109 #define LOGFS_I5_SIZE (I5_BLOCKS * LOGFS_BLOCKSIZE)
116 #define LOGFS_FULLY_POPULATED (1ULL << 63)
117 #define pure_ofs(ofs) (ofs & ~LOGFS_FULLY_POPULATED)
133 #define LOGFS_MAX_INDIRECT (5)
134 #define LOGFS_MAX_LEVELS (LOGFS_MAX_INDIRECT + 1)
135 #define LOGFS_NO_AREAS (2 * LOGFS_MAX_LEVELS)
138 #define LOGFS_MAX_NAMELEN (255)
141 #define LOGFS_JOURNAL_SEGS (16)
144 #define MAX_CACHED_SEGS (64)
155 #define LOGFS_OBJECT_HEADERSIZE (0x1c)
156 #define LOGFS_SEGMENT_HEADERSIZE (0x18)
157 #define LOGFS_MAX_OBJECTSIZE (LOGFS_OBJECT_HEADERSIZE + LOGFS_BLOCKSIZE)
158 #define LOGFS_SEGMENT_RESERVE \
159 (LOGFS_SEGMENT_HEADERSIZE + LOGFS_MAX_OBJECTSIZE - 1)
196 #define LOGFS_FEATURES_INCOMPAT (0ull)
197 #define LOGFS_FEATURES_RO_COMPAT (0ull)
198 #define LOGFS_FEATURES_COMPAT (0ull)
320 #define LOGFS_IF_COMPRESSED 0x00000004
321 #define LOGFS_IF_DIRTY 0x20000000
322 #define LOGFS_IF_ZOMBIE 0x40000000
323 #define LOGFS_IF_STILLBORN 0x80000000
326 #define LOGFS_FL_USER_VISIBLE (LOGFS_IF_COMPRESSED)
327 #define LOGFS_FL_USER_MODIFIABLE (LOGFS_IF_COMPRESSED)
329 #define LOGFS_FL_INHERITED (LOGFS_IF_COMPRESSED)
370 #define INODE_POINTER_OFS \
371 (offsetof(struct logfs_disk_inode, di_data) / sizeof(__be64))
372 #define INODE_USED_OFS \
373 (offsetof(struct logfs_disk_inode, di_used_bytes) / sizeof(__be64))
374 #define INODE_SIZE_OFS \
375 (offsetof(struct logfs_disk_inode, di_size) / sizeof(__be64))
376 #define INODE_HEIGHT_OFS (0)
396 #define RESERVED 0xffffffff
397 #define BADSEG 0xffffffff
473 #define MAX_JOURNAL_HEADER \
474 (sizeof(struct logfs_journal_header) + sizeof(struct logfs_je_area))