Lines Matching +full:block +full:- +full:size

1 /* SPDX-License-Identifier: GPL-2.0-only */
5 * On-disk structures for OCFS2.
23 * Block OCFS2_SUPER_BLOCK_BLKNO: OCFS2 superblock.
33 * Cluster size limits. The maximum is kept arbitrarily at 1 MB, and could
41 * minimum cluster size.
59 ( OCFS2_SB(sb)->s_feature_compat & (mask) )
61 ( OCFS2_SB(sb)->s_feature_ro_compat & (mask) )
63 ( OCFS2_SB(sb)->s_feature_incompat & (mask) )
65 OCFS2_SB(sb)->s_feature_compat |= (mask)
67 OCFS2_SB(sb)->s_feature_ro_compat |= (mask)
69 OCFS2_SB(sb)->s_feature_incompat |= (mask)
71 OCFS2_SB(sb)->s_feature_compat &= ~(mask)
73 OCFS2_SB(sb)->s_feature_ro_compat &= ~(mask)
75 OCFS2_SB(sb)->s_feature_incompat &= ~(mask)
96 * Heartbeat-only devices are missing journals and other files. The
105 * after an aborted run without fsck-ing.
109 /* Used to denote a non-clustered volume */
112 /* Support for sparse allocation in b-trees */
119 * fsck-ing.
121 * s_tunefs_flags on the super block describes precisely which
155 /* Discontiguous block groups */
193 /* The byte offset of the first backup block will be 1G.
215 #define OCFS2_SUPER_BLOCK_FL (0x00000020) /* Super block */
232 #define OCFS2_INLINE_DATA_FL (0x0001) /* Data stored in inode block */
252 /* End compression flags --- maybe not all used */
254 #define OCFS2_INDEX_FL FS_INDEX_FL /* hash-indexed directory */
291 #define OCFS2_INVALID_SLOT ((u16)-1)
307 * Inline extended attribute size (in bytes)
348 (NUM_SYSTEM_INODES - OCFS2_FIRST_LOCAL_SYSTEM_INODE)
363 /* Slot-specific system inodes (one copy per slot) */
385 #define OCFS2_DIR_ROUND (OCFS2_DIR_PAD - 1)
393 #define OCFS2_DX_LINK_MAX ((1U << 31) - 1U)
401 #define OCFS2_RAW_SB(dinode) (&((dinode)->id2.i_super))
404 * Block checking structure. This is used in metadata to validate the
410 __le16 bc_ecc; /* Single-error-correction parity vector.
464 used - tree_depth is never that big.
480 /*00*/ __le16 cl_cpg; /* Clusters per Block Group */
501 * On disk extent block (indirect block) for OCFS2
510 block group */
511 __le32 h_fs_generation; /* Must match super block */
513 /*20*/ __le64 h_suballoc_loc; /* Suballocator block group this
516 discontiguous block group */
521 /* Actual on-disk size is one block */
527 * value -1 (0xFFFF) is OCFS2_INVALID_SLOT. This marks a slot empty.
532 * Actual on-disk size is one block. OCFS2_MAX_SLOTS is 255,
533 * 255 * sizeof(__le16) == 512B, within the 512B block minimum blocksize.
553 * Actual size is i_size of the slot_map system file. It should
594 __le32 s_feature_ro_compat; /* Readonly-compatible feature set */
605 __le64 s_first_cluster_group; /* Block offset of 1st cluster
608 /*90*/ __u8 s_uuid[OCFS2_VOL_UUID_LEN]; /* 128-bit uuid */
612 /*B8*/ __le16 s_xattr_inline_size; /* extended attribute inline size
615 __le32 s_dx_seed[3]; /* seed[0-2] for dx dir hash.
638 __le16 la_size; /* Size of included bitmap, in bytes */
645 * Data-in-inode header. This is only used if i_dyn_features has
666 block group */
672 /*20*/ __le64 i_size; /* Size in bytes */
682 block */
683 /*60*/ __le32 i_fs_generation; /* Generation per fs-instance */
693 /*88*/ __le64 i_dx_root; /* Pointer to dir index root block */
695 __le64 i_suballoc_loc; /* Suballocator block group this
698 discontiguous block group */
732 /* Actual on-disk size is one block */
736 * On-disk directory entry structure for OCFS2
738 * Packed as this structure could be accessed unaligned on 64-bit platforms
746 /* Actual on-disk length specified by rec_len */
750 * Per-block record for the unindexed directory btree. This is carefully
765 __le16 db_free_rec_len; /* Size of largest empty hole
766 * in this block. (unused) */
769 /*20*/ __le64 db_free_next; /* Next block in list (unused) */
788 * block in cluster */
789 __le64 dx_dirent_blk; /* Physical block in unindexed
807 * A directory indexing block. Each indexed directory has one of these,
810 * This block stores an indexed btree root, and a set of free space
811 * start-of-list pointers.
817 * block belongs to. */
819 * block group */
820 __le32 dr_fs_generation; /* Must match super block */
823 * extent block */
835 * unindexed block list. */
836 __le64 dr_suballoc_loc; /* Suballocator block group
840 block group */
846 struct ocfs2_dx_entry_list dr_entries; /* In-root-block list of
854 * The header of a leaf block in the indexed tree.
860 __le32 dl_fs_generation;/* Must match super block */
867 * Largest bitmap for a block (suballocator) group in bytes. This limit
869 * bitmaps run to the end of the block.
879 __le16 bg_size; /* Size of included bitmap in
899 * Block groups may be discontiguous when
901 * The extents of a discontiguous block group are
904 * discontiguous group is signified by a non-zero
905 * bg_list->l_next_free_rec. Only block groups
907 * We've never made a block group with more than
910 * bg_size of a discontiguous block group will
917 /* Actual on-disk size is one block */
943 __le16 rf_suballoc_slot; /* Slot suballocator this block
946 block group */
949 __le64 rf_parent; /* Parent block, only valid if
953 __le64 rf_last_eb_blk; /* Pointer to last extent block */
962 __le64 rf_suballoc_loc; /* Suballocator block group this
963 refcount block belongs to. Only
965 discontiguous block group */
975 /* Actual on-disk size is one block */
985 * Note that it can be stored in inode, one block or one xattr bucket.
990 local xattr storage(inode, xattr block or
1020 buckets. A block uses
1030 * b-tree like file data. The xattr value root points to this structure.
1035 __le64 xr_last_eb_blk; /* Pointer to last extent block */
1043 * attributes will be organized and stored in an indexed-btree.
1048 __le64 xt_last_eb_blk; /* Pointer to last extent block */
1055 #define OCFS2_XATTR_SIZE(size) (((size) + OCFS2_XATTR_ROUND) & \ argument
1063 * On disk structure for xattr block.
1068 block belongs to. */
1070 block group */
1071 __le32 xb_fs_generation; /* Must match super block */
1074 /*20*/ __le16 xb_flags; /* Indicates whether this block contains
1078 __le64 xb_suballoc_loc; /* Suballocator block group this
1079 xattr block belongs to. Only
1081 discontiguous block group */
1084 block contains xattr */
1086 block cotains xattr
1097 xe->xe_type |= OCFS2_XATTR_ENTRY_LOCAL; in ocfs2_xattr_set_local()
1099 xe->xe_type &= ~OCFS2_XATTR_ENTRY_LOCAL; in ocfs2_xattr_set_local()
1104 return xe->xe_type & OCFS2_XATTR_ENTRY_LOCAL; in ocfs2_xattr_is_local()
1109 xe->xe_type |= type & OCFS2_XATTR_TYPE_MASK; in ocfs2_xattr_set_type()
1114 return xe->xe_type & OCFS2_XATTR_TYPE_MASK; in ocfs2_xattr_get_type()
1133 /* Each block of each quota file has a certain fixed number of bytes reserved
1154 /*10*/ __le32 dqi_free_blk; /* First free block in quota file */
1155 __le32 dqi_free_entry; /* First block with free dquot entry in quota
1177 * On-disk structures for local quota file
1222 * The quota trailer lives at the end of each quota block.
1234 ptr += blocksize - OCFS2_QBLK_RESERVED_SPACE; in ocfs2_block_dqtrailer()
1242 return sb->s_blocksize - in ocfs2_fast_symlink_chars()
1249 unsigned int xattrsize = le16_to_cpu(di->i_xattr_inline_size); in ocfs2_max_inline_data_with_xattr()
1251 if (le16_to_cpu(di->i_dyn_features) & OCFS2_INLINE_XATTR_FL) in ocfs2_max_inline_data_with_xattr()
1252 return sb->s_blocksize - in ocfs2_max_inline_data_with_xattr()
1253 offsetof(struct ocfs2_dinode, id2.i_data.id_data) - in ocfs2_max_inline_data_with_xattr()
1256 return sb->s_blocksize - in ocfs2_max_inline_data_with_xattr()
1262 int size; in ocfs2_extent_recs_per_inode() local
1264 size = sb->s_blocksize - in ocfs2_extent_recs_per_inode()
1267 return size / sizeof(struct ocfs2_extent_rec); in ocfs2_extent_recs_per_inode()
1274 int size; in ocfs2_extent_recs_per_inode_with_xattr() local
1275 unsigned int xattrsize = le16_to_cpu(di->i_xattr_inline_size); in ocfs2_extent_recs_per_inode_with_xattr()
1277 if (le16_to_cpu(di->i_dyn_features) & OCFS2_INLINE_XATTR_FL) in ocfs2_extent_recs_per_inode_with_xattr()
1278 size = sb->s_blocksize - in ocfs2_extent_recs_per_inode_with_xattr()
1279 offsetof(struct ocfs2_dinode, id2.i_list.l_recs) - in ocfs2_extent_recs_per_inode_with_xattr()
1282 size = sb->s_blocksize - in ocfs2_extent_recs_per_inode_with_xattr()
1285 return size / sizeof(struct ocfs2_extent_rec); in ocfs2_extent_recs_per_inode_with_xattr()
1290 int size; in ocfs2_extent_recs_per_dx_root() local
1292 size = sb->s_blocksize - in ocfs2_extent_recs_per_dx_root()
1295 return size / sizeof(struct ocfs2_extent_rec); in ocfs2_extent_recs_per_dx_root()
1300 int size; in ocfs2_chain_recs_per_inode() local
1302 size = sb->s_blocksize - in ocfs2_chain_recs_per_inode()
1305 return size / sizeof(struct ocfs2_chain_rec); in ocfs2_chain_recs_per_inode()
1310 int size; in ocfs2_extent_recs_per_eb() local
1312 size = sb->s_blocksize - in ocfs2_extent_recs_per_eb()
1315 return size / sizeof(struct ocfs2_extent_rec); in ocfs2_extent_recs_per_eb()
1320 int size; in ocfs2_extent_recs_per_gd() local
1322 size = sb->s_blocksize - in ocfs2_extent_recs_per_gd()
1325 return size / sizeof(struct ocfs2_extent_rec); in ocfs2_extent_recs_per_gd()
1330 int size; in ocfs2_dx_entries_per_leaf() local
1332 size = sb->s_blocksize - in ocfs2_dx_entries_per_leaf()
1335 return size / sizeof(struct ocfs2_dx_entry); in ocfs2_dx_entries_per_leaf()
1340 int size; in ocfs2_dx_entries_per_root() local
1342 size = sb->s_blocksize - in ocfs2_dx_entries_per_root()
1345 return size / sizeof(struct ocfs2_dx_entry); in ocfs2_dx_entries_per_root()
1350 u16 size; in ocfs2_local_alloc_size() local
1352 size = sb->s_blocksize - in ocfs2_local_alloc_size()
1355 return size; in ocfs2_local_alloc_size()
1362 int size = sb->s_blocksize - in ocfs2_group_bitmap_size() local
1366 * The cluster allocator uses the entire block. Suballocators have in ocfs2_group_bitmap_size()
1369 * bg_size as-is unless discontig_bg is enabled. in ocfs2_group_bitmap_size()
1373 size = OCFS2_MAX_BG_BITMAP_SIZE; in ocfs2_group_bitmap_size()
1375 return size; in ocfs2_group_bitmap_size()
1380 int size; in ocfs2_truncate_recs_per_inode() local
1382 size = sb->s_blocksize - in ocfs2_truncate_recs_per_inode()
1385 return size / sizeof(struct ocfs2_truncate_rec); in ocfs2_truncate_recs_per_inode()
1394 offset >>= sb->s_blocksize_bits; in ocfs2_backup_super_blkno()
1404 int size; in ocfs2_xattr_recs_per_xb() local
1406 size = sb->s_blocksize - in ocfs2_xattr_recs_per_xb()
1410 return size / sizeof(struct ocfs2_extent_rec); in ocfs2_xattr_recs_per_xb()
1415 int size; in ocfs2_extent_recs_per_rb() local
1417 size = sb->s_blocksize - in ocfs2_extent_recs_per_rb()
1420 return size / sizeof(struct ocfs2_extent_rec); in ocfs2_extent_recs_per_rb()
1425 int size; in ocfs2_refcount_recs_per_rb() local
1427 size = sb->s_blocksize - in ocfs2_refcount_recs_per_rb()
1430 return size / sizeof(struct ocfs2_refcount_rec); in ocfs2_refcount_recs_per_rb()
1436 return le64_to_cpu(rec->r_cpos) & OCFS2_32BIT_POS_MASK; in ocfs2_get_ref_rec_low_cpos()
1441 return blocksize - offsetof(struct ocfs2_dinode, id2.i_symlink); in ocfs2_fast_symlink_chars()
1447 if (di && (di->i_dyn_features & OCFS2_INLINE_XATTR_FL)) in ocfs2_max_inline_data_with_xattr()
1448 return blocksize - in ocfs2_max_inline_data_with_xattr()
1449 offsetof(struct ocfs2_dinode, id2.i_data.id_data) - in ocfs2_max_inline_data_with_xattr()
1450 di->i_xattr_inline_size; in ocfs2_max_inline_data_with_xattr()
1452 return blocksize - in ocfs2_max_inline_data_with_xattr()
1458 int size; in ocfs2_extent_recs_per_inode() local
1460 size = blocksize - in ocfs2_extent_recs_per_inode()
1463 return size / sizeof(struct ocfs2_extent_rec); in ocfs2_extent_recs_per_inode()
1468 int size; in ocfs2_chain_recs_per_inode() local
1470 size = blocksize - in ocfs2_chain_recs_per_inode()
1473 return size / sizeof(struct ocfs2_chain_rec); in ocfs2_chain_recs_per_inode()
1478 int size; in ocfs2_extent_recs_per_eb() local
1480 size = blocksize - in ocfs2_extent_recs_per_eb()
1483 return size / sizeof(struct ocfs2_extent_rec); in ocfs2_extent_recs_per_eb()
1488 int size; in ocfs2_extent_recs_per_gd() local
1490 size = blocksize - in ocfs2_extent_recs_per_gd()
1493 return size / sizeof(struct ocfs2_extent_rec); in ocfs2_extent_recs_per_gd()
1498 int size; in ocfs2_local_alloc_size() local
1500 size = blocksize - in ocfs2_local_alloc_size()
1503 return size; in ocfs2_local_alloc_size()
1510 int size = sb->s_blocksize - in ocfs2_group_bitmap_size() local
1514 * The cluster allocator uses the entire block. Suballocators have in ocfs2_group_bitmap_size()
1517 * bg_size as-is unless discontig_bg is enabled. in ocfs2_group_bitmap_size()
1521 size = OCFS2_MAX_BG_BITMAP_SIZE; in ocfs2_group_bitmap_size()
1523 return size; in ocfs2_group_bitmap_size()
1528 int size; in ocfs2_truncate_recs_per_inode() local
1530 size = blocksize - in ocfs2_truncate_recs_per_inode()
1533 return size / sizeof(struct ocfs2_truncate_rec); in ocfs2_truncate_recs_per_inode()
1551 int size; in ocfs2_xattr_recs_per_xb() local
1553 size = blocksize - in ocfs2_xattr_recs_per_xb()
1557 return size / sizeof(struct ocfs2_extent_rec); in ocfs2_xattr_recs_per_xb()
1592 de->file_type = fs_umode_to_ftype(mode); in ocfs2_set_de_type()
1598 le16_to_cpu(gd->bg_size)) != in ocfs2_gd_is_discontig()
1605 if (!gd->bg_list.l_next_free_rec) in ocfs2_gd_is_discontig()