then data can be stored almost anywhere. However, clustering the data with related data will minimize seek times and maximize performance. ext2 attempts to allocate each new directory in the group containing its parent directory, on the theory that accesses to parent and children directories are likely to be closely related. ext2 also attempts to place files in the same group as their directory entries, because directory accesses often lead to file accesses. However, if the group is full, then the new file or new directory is placed in some other non-full group. The data blocks needed to store directories and files can be found by looking in the data allocation bitmap. Any needed space in the inode table can be found by looking in the inode allocation bitmap. File-system limits The reason for some limits of ext2 are the file format of the data and the operating system's kernel. Mostly these factors will be determined once when the file system is built. They depend on the block size and the ratio of the number of blocks and inodes. In Linux the block size is limited by the architecture page size. There are also some userspace programs that cannot handle files larger than 2 GiB. If b is the block size, the maximal file size is limited to min( ((b/4)3 + (b/4)2 + b/4 + 12) × b, (232 − 1) × 512 ) due to the i_block structure (an array of direct/indirect EXT2_N_BLOCKS) and i_blocks (32-bit integer value) representing the number of 512-byte "blocks" in the file. The maximal number of sublevel-directories is 31998, due to the link-count limit. Directory indexing is not available in ext2, so there are performance issues for directories with a large number of files (>10,000). The theoretical limit on the number of files in a directory is 1.3 × 1020, although this is not relevant for practical situations. Note: In Linux 2.4 and earlier, block devices were limited to 2 TiB, limiting the maximal size of a partition, regardless of block size. Compression extension e2compr is a modification to the ext2 driver in the Linux kernel to support compression and decompression of files by the file system, without any support by user applications. e2compr is a small patch against ext2. e2compr compresses only regular files; the administrative data (superblock, inodes, directory files, etc.) are not compressed (mainly for safety reasons). Access to compressed blocks