18c2ecf20Sopenharmony_ci.. SPDX-License-Identifier: GPL-2.0
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ciHigh Level Design
48c2ecf20Sopenharmony_ci=================
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ciAn ext4 file system is split into a series of block groups. To reduce
78c2ecf20Sopenharmony_ciperformance difficulties due to fragmentation, the block allocator tries
88c2ecf20Sopenharmony_civery hard to keep each file's blocks within the same group, thereby
98c2ecf20Sopenharmony_cireducing seek times. The size of a block group is specified in
108c2ecf20Sopenharmony_ci``sb.s_blocks_per_group`` blocks, though it can also calculated as 8 \*
118c2ecf20Sopenharmony_ci``block_size_in_bytes``. With the default block size of 4KiB, each group
128c2ecf20Sopenharmony_ciwill contain 32,768 blocks, for a length of 128MiB. The number of block
138c2ecf20Sopenharmony_cigroups is the size of the device divided by the size of a block group.
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ciAll fields in ext4 are written to disk in little-endian order. HOWEVER,
168c2ecf20Sopenharmony_ciall fields in jbd2 (the journal) are written to disk in big-endian
178c2ecf20Sopenharmony_ciorder.
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci.. include:: blocks.rst
208c2ecf20Sopenharmony_ci.. include:: blockgroup.rst
218c2ecf20Sopenharmony_ci.. include:: special_inodes.rst
228c2ecf20Sopenharmony_ci.. include:: allocators.rst
238c2ecf20Sopenharmony_ci.. include:: checksums.rst
248c2ecf20Sopenharmony_ci.. include:: bigalloc.rst
258c2ecf20Sopenharmony_ci.. include:: inlinedata.rst
268c2ecf20Sopenharmony_ci.. include:: eainode.rst
278c2ecf20Sopenharmony_ci.. include:: verity.rst
28