18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only OR Apache-2.0 */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * EROFS (Enhanced ROM File System) on-disk format definition 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Copyright (C) 2017-2018 HUAWEI, Inc. 68c2ecf20Sopenharmony_ci * https://www.huawei.com/ 78c2ecf20Sopenharmony_ci * Created by Gao Xiang <gaoxiang25@huawei.com> 88c2ecf20Sopenharmony_ci */ 98c2ecf20Sopenharmony_ci#ifndef __EROFS_FS_H 108c2ecf20Sopenharmony_ci#define __EROFS_FS_H 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ci#define EROFS_SUPER_OFFSET 1024 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_ci#define EROFS_FEATURE_COMPAT_SB_CHKSUM 0x00000001 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_ci/* 178c2ecf20Sopenharmony_ci * Any bits that aren't in EROFS_ALL_FEATURE_INCOMPAT should 188c2ecf20Sopenharmony_ci * be incompatible with this kernel version. 198c2ecf20Sopenharmony_ci */ 208c2ecf20Sopenharmony_ci#define EROFS_FEATURE_INCOMPAT_LZ4_0PADDING 0x00000001 218c2ecf20Sopenharmony_ci#define EROFS_ALL_FEATURE_INCOMPAT EROFS_FEATURE_INCOMPAT_LZ4_0PADDING 228c2ecf20Sopenharmony_ci 238c2ecf20Sopenharmony_ci/* 128-byte erofs on-disk super block */ 248c2ecf20Sopenharmony_cistruct erofs_super_block { 258c2ecf20Sopenharmony_ci __le32 magic; /* file system magic number */ 268c2ecf20Sopenharmony_ci __le32 checksum; /* crc32c(super_block) */ 278c2ecf20Sopenharmony_ci __le32 feature_compat; 288c2ecf20Sopenharmony_ci __u8 blkszbits; /* support block_size == PAGE_SIZE only */ 298c2ecf20Sopenharmony_ci __u8 reserved; 308c2ecf20Sopenharmony_ci 318c2ecf20Sopenharmony_ci __le16 root_nid; /* nid of root directory */ 328c2ecf20Sopenharmony_ci __le64 inos; /* total valid ino # (== f_files - f_favail) */ 338c2ecf20Sopenharmony_ci 348c2ecf20Sopenharmony_ci __le64 build_time; /* inode v1 time derivation */ 358c2ecf20Sopenharmony_ci __le32 build_time_nsec; /* inode v1 time derivation in nano scale */ 368c2ecf20Sopenharmony_ci __le32 blocks; /* used for statfs */ 378c2ecf20Sopenharmony_ci __le32 meta_blkaddr; /* start block address of metadata area */ 388c2ecf20Sopenharmony_ci __le32 xattr_blkaddr; /* start block address of shared xattr area */ 398c2ecf20Sopenharmony_ci __u8 uuid[16]; /* 128-bit uuid for volume */ 408c2ecf20Sopenharmony_ci __u8 volume_name[16]; /* volume name */ 418c2ecf20Sopenharmony_ci __le32 feature_incompat; 428c2ecf20Sopenharmony_ci __u8 reserved2[44]; 438c2ecf20Sopenharmony_ci}; 448c2ecf20Sopenharmony_ci 458c2ecf20Sopenharmony_ci/* 468c2ecf20Sopenharmony_ci * erofs inode datalayout (i_format in on-disk inode): 478c2ecf20Sopenharmony_ci * 0 - inode plain without inline data A: 488c2ecf20Sopenharmony_ci * inode, [xattrs], ... | ... | no-holed data 498c2ecf20Sopenharmony_ci * 1 - inode VLE compression B (legacy): 508c2ecf20Sopenharmony_ci * inode, [xattrs], extents ... | ... 518c2ecf20Sopenharmony_ci * 2 - inode plain with inline data C: 528c2ecf20Sopenharmony_ci * inode, [xattrs], last_inline_data, ... | ... | no-holed data 538c2ecf20Sopenharmony_ci * 3 - inode compression D: 548c2ecf20Sopenharmony_ci * inode, [xattrs], map_header, extents ... | ... 558c2ecf20Sopenharmony_ci * 4~7 - reserved 568c2ecf20Sopenharmony_ci */ 578c2ecf20Sopenharmony_cienum { 588c2ecf20Sopenharmony_ci EROFS_INODE_FLAT_PLAIN = 0, 598c2ecf20Sopenharmony_ci EROFS_INODE_FLAT_COMPRESSION_LEGACY = 1, 608c2ecf20Sopenharmony_ci EROFS_INODE_FLAT_INLINE = 2, 618c2ecf20Sopenharmony_ci EROFS_INODE_FLAT_COMPRESSION = 3, 628c2ecf20Sopenharmony_ci EROFS_INODE_DATALAYOUT_MAX 638c2ecf20Sopenharmony_ci}; 648c2ecf20Sopenharmony_ci 658c2ecf20Sopenharmony_cistatic inline bool erofs_inode_is_data_compressed(unsigned int datamode) 668c2ecf20Sopenharmony_ci{ 678c2ecf20Sopenharmony_ci return datamode == EROFS_INODE_FLAT_COMPRESSION || 688c2ecf20Sopenharmony_ci datamode == EROFS_INODE_FLAT_COMPRESSION_LEGACY; 698c2ecf20Sopenharmony_ci} 708c2ecf20Sopenharmony_ci 718c2ecf20Sopenharmony_ci/* bit definitions of inode i_advise */ 728c2ecf20Sopenharmony_ci#define EROFS_I_VERSION_BITS 1 738c2ecf20Sopenharmony_ci#define EROFS_I_DATALAYOUT_BITS 3 748c2ecf20Sopenharmony_ci 758c2ecf20Sopenharmony_ci#define EROFS_I_VERSION_BIT 0 768c2ecf20Sopenharmony_ci#define EROFS_I_DATALAYOUT_BIT 1 778c2ecf20Sopenharmony_ci 788c2ecf20Sopenharmony_ci#define EROFS_I_ALL \ 798c2ecf20Sopenharmony_ci ((1 << (EROFS_I_DATALAYOUT_BIT + EROFS_I_DATALAYOUT_BITS)) - 1) 808c2ecf20Sopenharmony_ci 818c2ecf20Sopenharmony_ci/* 32-byte reduced form of an ondisk inode */ 828c2ecf20Sopenharmony_cistruct erofs_inode_compact { 838c2ecf20Sopenharmony_ci __le16 i_format; /* inode format hints */ 848c2ecf20Sopenharmony_ci 858c2ecf20Sopenharmony_ci/* 1 header + n-1 * 4 bytes inline xattr to keep continuity */ 868c2ecf20Sopenharmony_ci __le16 i_xattr_icount; 878c2ecf20Sopenharmony_ci __le16 i_mode; 888c2ecf20Sopenharmony_ci __le16 i_nlink; 898c2ecf20Sopenharmony_ci __le32 i_size; 908c2ecf20Sopenharmony_ci __le32 i_reserved; 918c2ecf20Sopenharmony_ci union { 928c2ecf20Sopenharmony_ci /* file total compressed blocks for data mapping 1 */ 938c2ecf20Sopenharmony_ci __le32 compressed_blocks; 948c2ecf20Sopenharmony_ci __le32 raw_blkaddr; 958c2ecf20Sopenharmony_ci 968c2ecf20Sopenharmony_ci /* for device files, used to indicate old/new device # */ 978c2ecf20Sopenharmony_ci __le32 rdev; 988c2ecf20Sopenharmony_ci } i_u; 998c2ecf20Sopenharmony_ci __le32 i_ino; /* only used for 32-bit stat compatibility */ 1008c2ecf20Sopenharmony_ci __le16 i_uid; 1018c2ecf20Sopenharmony_ci __le16 i_gid; 1028c2ecf20Sopenharmony_ci __le32 i_reserved2; 1038c2ecf20Sopenharmony_ci}; 1048c2ecf20Sopenharmony_ci 1058c2ecf20Sopenharmony_ci/* 32 bytes on-disk inode */ 1068c2ecf20Sopenharmony_ci#define EROFS_INODE_LAYOUT_COMPACT 0 1078c2ecf20Sopenharmony_ci/* 64 bytes on-disk inode */ 1088c2ecf20Sopenharmony_ci#define EROFS_INODE_LAYOUT_EXTENDED 1 1098c2ecf20Sopenharmony_ci 1108c2ecf20Sopenharmony_ci/* 64-byte complete form of an ondisk inode */ 1118c2ecf20Sopenharmony_cistruct erofs_inode_extended { 1128c2ecf20Sopenharmony_ci __le16 i_format; /* inode format hints */ 1138c2ecf20Sopenharmony_ci 1148c2ecf20Sopenharmony_ci/* 1 header + n-1 * 4 bytes inline xattr to keep continuity */ 1158c2ecf20Sopenharmony_ci __le16 i_xattr_icount; 1168c2ecf20Sopenharmony_ci __le16 i_mode; 1178c2ecf20Sopenharmony_ci __le16 i_reserved; 1188c2ecf20Sopenharmony_ci __le64 i_size; 1198c2ecf20Sopenharmony_ci union { 1208c2ecf20Sopenharmony_ci /* file total compressed blocks for data mapping 1 */ 1218c2ecf20Sopenharmony_ci __le32 compressed_blocks; 1228c2ecf20Sopenharmony_ci __le32 raw_blkaddr; 1238c2ecf20Sopenharmony_ci 1248c2ecf20Sopenharmony_ci /* for device files, used to indicate old/new device # */ 1258c2ecf20Sopenharmony_ci __le32 rdev; 1268c2ecf20Sopenharmony_ci } i_u; 1278c2ecf20Sopenharmony_ci 1288c2ecf20Sopenharmony_ci /* only used for 32-bit stat compatibility */ 1298c2ecf20Sopenharmony_ci __le32 i_ino; 1308c2ecf20Sopenharmony_ci 1318c2ecf20Sopenharmony_ci __le32 i_uid; 1328c2ecf20Sopenharmony_ci __le32 i_gid; 1338c2ecf20Sopenharmony_ci __le64 i_ctime; 1348c2ecf20Sopenharmony_ci __le32 i_ctime_nsec; 1358c2ecf20Sopenharmony_ci __le32 i_nlink; 1368c2ecf20Sopenharmony_ci __u8 i_reserved2[16]; 1378c2ecf20Sopenharmony_ci}; 1388c2ecf20Sopenharmony_ci 1398c2ecf20Sopenharmony_ci#define EROFS_MAX_SHARED_XATTRS (128) 1408c2ecf20Sopenharmony_ci/* h_shared_count between 129 ... 255 are special # */ 1418c2ecf20Sopenharmony_ci#define EROFS_SHARED_XATTR_EXTENT (255) 1428c2ecf20Sopenharmony_ci 1438c2ecf20Sopenharmony_ci/* 1448c2ecf20Sopenharmony_ci * inline xattrs (n == i_xattr_icount): 1458c2ecf20Sopenharmony_ci * erofs_xattr_ibody_header(1) + (n - 1) * 4 bytes 1468c2ecf20Sopenharmony_ci * 12 bytes / \ 1478c2ecf20Sopenharmony_ci * / \ 1488c2ecf20Sopenharmony_ci * /-----------------------\ 1498c2ecf20Sopenharmony_ci * | erofs_xattr_entries+ | 1508c2ecf20Sopenharmony_ci * +-----------------------+ 1518c2ecf20Sopenharmony_ci * inline xattrs must starts in erofs_xattr_ibody_header, 1528c2ecf20Sopenharmony_ci * for read-only fs, no need to introduce h_refcount 1538c2ecf20Sopenharmony_ci */ 1548c2ecf20Sopenharmony_cistruct erofs_xattr_ibody_header { 1558c2ecf20Sopenharmony_ci __le32 h_reserved; 1568c2ecf20Sopenharmony_ci __u8 h_shared_count; 1578c2ecf20Sopenharmony_ci __u8 h_reserved2[7]; 1588c2ecf20Sopenharmony_ci __le32 h_shared_xattrs[0]; /* shared xattr id array */ 1598c2ecf20Sopenharmony_ci}; 1608c2ecf20Sopenharmony_ci 1618c2ecf20Sopenharmony_ci/* Name indexes */ 1628c2ecf20Sopenharmony_ci#define EROFS_XATTR_INDEX_USER 1 1638c2ecf20Sopenharmony_ci#define EROFS_XATTR_INDEX_POSIX_ACL_ACCESS 2 1648c2ecf20Sopenharmony_ci#define EROFS_XATTR_INDEX_POSIX_ACL_DEFAULT 3 1658c2ecf20Sopenharmony_ci#define EROFS_XATTR_INDEX_TRUSTED 4 1668c2ecf20Sopenharmony_ci#define EROFS_XATTR_INDEX_LUSTRE 5 1678c2ecf20Sopenharmony_ci#define EROFS_XATTR_INDEX_SECURITY 6 1688c2ecf20Sopenharmony_ci 1698c2ecf20Sopenharmony_ci/* xattr entry (for both inline & shared xattrs) */ 1708c2ecf20Sopenharmony_cistruct erofs_xattr_entry { 1718c2ecf20Sopenharmony_ci __u8 e_name_len; /* length of name */ 1728c2ecf20Sopenharmony_ci __u8 e_name_index; /* attribute name index */ 1738c2ecf20Sopenharmony_ci __le16 e_value_size; /* size of attribute value */ 1748c2ecf20Sopenharmony_ci /* followed by e_name and e_value */ 1758c2ecf20Sopenharmony_ci char e_name[0]; /* attribute name */ 1768c2ecf20Sopenharmony_ci}; 1778c2ecf20Sopenharmony_ci 1788c2ecf20Sopenharmony_cistatic inline unsigned int erofs_xattr_ibody_size(__le16 i_xattr_icount) 1798c2ecf20Sopenharmony_ci{ 1808c2ecf20Sopenharmony_ci if (!i_xattr_icount) 1818c2ecf20Sopenharmony_ci return 0; 1828c2ecf20Sopenharmony_ci 1838c2ecf20Sopenharmony_ci return sizeof(struct erofs_xattr_ibody_header) + 1848c2ecf20Sopenharmony_ci sizeof(__u32) * (le16_to_cpu(i_xattr_icount) - 1); 1858c2ecf20Sopenharmony_ci} 1868c2ecf20Sopenharmony_ci 1878c2ecf20Sopenharmony_ci#define EROFS_XATTR_ALIGN(size) round_up(size, sizeof(struct erofs_xattr_entry)) 1888c2ecf20Sopenharmony_ci 1898c2ecf20Sopenharmony_cistatic inline unsigned int erofs_xattr_entry_size(struct erofs_xattr_entry *e) 1908c2ecf20Sopenharmony_ci{ 1918c2ecf20Sopenharmony_ci return EROFS_XATTR_ALIGN(sizeof(struct erofs_xattr_entry) + 1928c2ecf20Sopenharmony_ci e->e_name_len + le16_to_cpu(e->e_value_size)); 1938c2ecf20Sopenharmony_ci} 1948c2ecf20Sopenharmony_ci 1958c2ecf20Sopenharmony_ci/* available compression algorithm types (for h_algorithmtype) */ 1968c2ecf20Sopenharmony_cienum { 1978c2ecf20Sopenharmony_ci Z_EROFS_COMPRESSION_LZ4 = 0, 1988c2ecf20Sopenharmony_ci Z_EROFS_COMPRESSION_MAX 1998c2ecf20Sopenharmony_ci}; 2008c2ecf20Sopenharmony_ci 2018c2ecf20Sopenharmony_ci/* 2028c2ecf20Sopenharmony_ci * bit 0 : COMPACTED_2B indexes (0 - off; 1 - on) 2038c2ecf20Sopenharmony_ci * e.g. for 4k logical cluster size, 4B if compacted 2B is off; 2048c2ecf20Sopenharmony_ci * (4B) + 2B + (4B) if compacted 2B is on. 2058c2ecf20Sopenharmony_ci */ 2068c2ecf20Sopenharmony_ci#define Z_EROFS_ADVISE_COMPACTED_2B_BIT 0 2078c2ecf20Sopenharmony_ci 2088c2ecf20Sopenharmony_ci#define Z_EROFS_ADVISE_COMPACTED_2B (1 << Z_EROFS_ADVISE_COMPACTED_2B_BIT) 2098c2ecf20Sopenharmony_ci 2108c2ecf20Sopenharmony_cistruct z_erofs_map_header { 2118c2ecf20Sopenharmony_ci __le32 h_reserved1; 2128c2ecf20Sopenharmony_ci __le16 h_advise; 2138c2ecf20Sopenharmony_ci /* 2148c2ecf20Sopenharmony_ci * bit 0-3 : algorithm type of head 1 (logical cluster type 01); 2158c2ecf20Sopenharmony_ci * bit 4-7 : algorithm type of head 2 (logical cluster type 11). 2168c2ecf20Sopenharmony_ci */ 2178c2ecf20Sopenharmony_ci __u8 h_algorithmtype; 2188c2ecf20Sopenharmony_ci /* 2198c2ecf20Sopenharmony_ci * bit 0-2 : logical cluster bits - 12, e.g. 0 for 4096; 2208c2ecf20Sopenharmony_ci * bit 3-4 : (physical - logical) cluster bits of head 1: 2218c2ecf20Sopenharmony_ci * For example, if logical clustersize = 4096, 1 for 8192. 2228c2ecf20Sopenharmony_ci * bit 5-7 : (physical - logical) cluster bits of head 2. 2238c2ecf20Sopenharmony_ci */ 2248c2ecf20Sopenharmony_ci __u8 h_clusterbits; 2258c2ecf20Sopenharmony_ci}; 2268c2ecf20Sopenharmony_ci 2278c2ecf20Sopenharmony_ci#define Z_EROFS_VLE_LEGACY_HEADER_PADDING 8 2288c2ecf20Sopenharmony_ci 2298c2ecf20Sopenharmony_ci/* 2308c2ecf20Sopenharmony_ci * Fixed-sized output compression ondisk Logical Extent cluster type: 2318c2ecf20Sopenharmony_ci * 0 - literal (uncompressed) cluster 2328c2ecf20Sopenharmony_ci * 1 - compressed cluster (for the head logical cluster) 2338c2ecf20Sopenharmony_ci * 2 - compressed cluster (for the other logical clusters) 2348c2ecf20Sopenharmony_ci * 2358c2ecf20Sopenharmony_ci * In detail, 2368c2ecf20Sopenharmony_ci * 0 - literal (uncompressed) cluster, 2378c2ecf20Sopenharmony_ci * di_advise = 0 2388c2ecf20Sopenharmony_ci * di_clusterofs = the literal data offset of the cluster 2398c2ecf20Sopenharmony_ci * di_blkaddr = the blkaddr of the literal cluster 2408c2ecf20Sopenharmony_ci * 2418c2ecf20Sopenharmony_ci * 1 - compressed cluster (for the head logical cluster) 2428c2ecf20Sopenharmony_ci * di_advise = 1 2438c2ecf20Sopenharmony_ci * di_clusterofs = the decompressed data offset of the cluster 2448c2ecf20Sopenharmony_ci * di_blkaddr = the blkaddr of the compressed cluster 2458c2ecf20Sopenharmony_ci * 2468c2ecf20Sopenharmony_ci * 2 - compressed cluster (for the other logical clusters) 2478c2ecf20Sopenharmony_ci * di_advise = 2 2488c2ecf20Sopenharmony_ci * di_clusterofs = 2498c2ecf20Sopenharmony_ci * the decompressed data offset in its own head cluster 2508c2ecf20Sopenharmony_ci * di_u.delta[0] = distance to its corresponding head cluster 2518c2ecf20Sopenharmony_ci * di_u.delta[1] = distance to its corresponding tail cluster 2528c2ecf20Sopenharmony_ci * (di_advise could be 0, 1 or 2) 2538c2ecf20Sopenharmony_ci */ 2548c2ecf20Sopenharmony_cienum { 2558c2ecf20Sopenharmony_ci Z_EROFS_VLE_CLUSTER_TYPE_PLAIN = 0, 2568c2ecf20Sopenharmony_ci Z_EROFS_VLE_CLUSTER_TYPE_HEAD = 1, 2578c2ecf20Sopenharmony_ci Z_EROFS_VLE_CLUSTER_TYPE_NONHEAD = 2, 2588c2ecf20Sopenharmony_ci Z_EROFS_VLE_CLUSTER_TYPE_RESERVED = 3, 2598c2ecf20Sopenharmony_ci Z_EROFS_VLE_CLUSTER_TYPE_MAX 2608c2ecf20Sopenharmony_ci}; 2618c2ecf20Sopenharmony_ci 2628c2ecf20Sopenharmony_ci#define Z_EROFS_VLE_DI_CLUSTER_TYPE_BITS 2 2638c2ecf20Sopenharmony_ci#define Z_EROFS_VLE_DI_CLUSTER_TYPE_BIT 0 2648c2ecf20Sopenharmony_ci 2658c2ecf20Sopenharmony_cistruct z_erofs_vle_decompressed_index { 2668c2ecf20Sopenharmony_ci __le16 di_advise; 2678c2ecf20Sopenharmony_ci /* where to decompress in the head cluster */ 2688c2ecf20Sopenharmony_ci __le16 di_clusterofs; 2698c2ecf20Sopenharmony_ci 2708c2ecf20Sopenharmony_ci union { 2718c2ecf20Sopenharmony_ci /* for the head cluster */ 2728c2ecf20Sopenharmony_ci __le32 blkaddr; 2738c2ecf20Sopenharmony_ci /* 2748c2ecf20Sopenharmony_ci * for the rest clusters 2758c2ecf20Sopenharmony_ci * eg. for 4k page-sized cluster, maximum 4K*64k = 256M) 2768c2ecf20Sopenharmony_ci * [0] - pointing to the head cluster 2778c2ecf20Sopenharmony_ci * [1] - pointing to the tail cluster 2788c2ecf20Sopenharmony_ci */ 2798c2ecf20Sopenharmony_ci __le16 delta[2]; 2808c2ecf20Sopenharmony_ci } di_u; 2818c2ecf20Sopenharmony_ci}; 2828c2ecf20Sopenharmony_ci 2838c2ecf20Sopenharmony_ci#define Z_EROFS_VLE_LEGACY_INDEX_ALIGN(size) \ 2848c2ecf20Sopenharmony_ci (round_up(size, sizeof(struct z_erofs_vle_decompressed_index)) + \ 2858c2ecf20Sopenharmony_ci sizeof(struct z_erofs_map_header) + Z_EROFS_VLE_LEGACY_HEADER_PADDING) 2868c2ecf20Sopenharmony_ci 2878c2ecf20Sopenharmony_ci/* dirent sorts in alphabet order, thus we can do binary search */ 2888c2ecf20Sopenharmony_cistruct erofs_dirent { 2898c2ecf20Sopenharmony_ci __le64 nid; /* node number */ 2908c2ecf20Sopenharmony_ci __le16 nameoff; /* start offset of file name */ 2918c2ecf20Sopenharmony_ci __u8 file_type; /* file type */ 2928c2ecf20Sopenharmony_ci __u8 reserved; /* reserved */ 2938c2ecf20Sopenharmony_ci} __packed; 2948c2ecf20Sopenharmony_ci 2958c2ecf20Sopenharmony_ci/* 2968c2ecf20Sopenharmony_ci * EROFS file types should match generic FT_* types and 2978c2ecf20Sopenharmony_ci * it seems no need to add BUILD_BUG_ONs since potential 2988c2ecf20Sopenharmony_ci * unmatchness will break other fses as well... 2998c2ecf20Sopenharmony_ci */ 3008c2ecf20Sopenharmony_ci 3018c2ecf20Sopenharmony_ci#define EROFS_NAME_LEN 255 3028c2ecf20Sopenharmony_ci 3038c2ecf20Sopenharmony_ci/* check the EROFS on-disk layout strictly at compile time */ 3048c2ecf20Sopenharmony_cistatic inline void erofs_check_ondisk_layout_definitions(void) 3058c2ecf20Sopenharmony_ci{ 3068c2ecf20Sopenharmony_ci BUILD_BUG_ON(sizeof(struct erofs_super_block) != 128); 3078c2ecf20Sopenharmony_ci BUILD_BUG_ON(sizeof(struct erofs_inode_compact) != 32); 3088c2ecf20Sopenharmony_ci BUILD_BUG_ON(sizeof(struct erofs_inode_extended) != 64); 3098c2ecf20Sopenharmony_ci BUILD_BUG_ON(sizeof(struct erofs_xattr_ibody_header) != 12); 3108c2ecf20Sopenharmony_ci BUILD_BUG_ON(sizeof(struct erofs_xattr_entry) != 4); 3118c2ecf20Sopenharmony_ci BUILD_BUG_ON(sizeof(struct z_erofs_map_header) != 8); 3128c2ecf20Sopenharmony_ci BUILD_BUG_ON(sizeof(struct z_erofs_vle_decompressed_index) != 8); 3138c2ecf20Sopenharmony_ci BUILD_BUG_ON(sizeof(struct erofs_dirent) != 12); 3148c2ecf20Sopenharmony_ci 3158c2ecf20Sopenharmony_ci BUILD_BUG_ON(BIT(Z_EROFS_VLE_DI_CLUSTER_TYPE_BITS) < 3168c2ecf20Sopenharmony_ci Z_EROFS_VLE_CLUSTER_TYPE_MAX - 1); 3178c2ecf20Sopenharmony_ci} 3188c2ecf20Sopenharmony_ci 3198c2ecf20Sopenharmony_ci#endif 3208c2ecf20Sopenharmony_ci 321