Ext4 Design
From Ext4
(Difference between revisions)
(→External References) |
|||
(6 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | + | === Design for ext4 === | |
− | * Ext3: default filesystem for many users, reputation of dependability & compatibility | + | * Ext3: default filesystem for many users, reputation of dependability & compatibility, leave existing ext3 users undisturbed, stable |
− | * Scaling up to support large filesystems: Storage advancements, Increasing data storage requirements | + | * Scaling up to support large filesystems: Storage advancements, Increasing data storage requirements, only large filesystem users move to ext4 |
− | * Features requiring on-disk format change: nanosec timestamps, fast | + | * Features requiring on-disk format change: nanosec timestamps, fast extent allocation, preallocation |
− | * Reliability wrt on-disk corruption | + | * Reliability wrt on-disk corruption |
+ | * 64 bit JBD split | ||
+ | * Forward compatibility/upgradeability | ||
+ | * Multiblock allocation | ||
+ | * [[DelayedAllocation|Delayed allocation]] | ||
+ | * [[Design For 1st Class Quota in Ext4 | 1st Class Quota Support]] (Implementation in progress) | ||
+ | * [[Design for BigAlloc | Large allocation blocks]] (Not yet implemented; in design phase) | ||
− | ' | + | === Ext4 Extents === |
+ | |||
+ | The core of the Ext4 FS is the support for extents. An extent is simply a set of blocks which are logically contiguous within the file and also on the underlying block device. Most contemporary filesystems put considerable effort into allocating contiguous blocks for files as a way of making I/O operations faster, so blocks which are logically contiguous within the file often are also contiguous on-disk. As a result, storing the file structure as extents should result in significant compression of the file's metadata, since a single extent can replace a large number of block pointers. The reduction in metadata should enable faster access as well. | ||
+ | |||
+ | === On-Disk Structures === | ||
<pre> | <pre> | ||
Line 32: | Line 42: | ||
}; | }; | ||
</pre> | </pre> | ||
+ | |||
+ | |||
+ | === External References === | ||
+ | |||
+ | * [http://foss.in/2006/cfp/slides/ext4-foss.pdf FOSS.in 2006 ext4 paper] | ||
+ | * [http://ext2.sourceforge.net/2005-ols/2005-ols-ext3-presentation.pdf OLS 2005 ext3 presentation] | ||
+ | * [http://ext2.sourceforge.net/2005-ols/2005-ext3-paper.pdf OLS 2005 ext3 paper] | ||
+ | * [http://lwn.net/Articles/187321/ Ext3 for large filesystems] (LWN June 12, 2006) |
Latest revision as of 07:06, 17 February 2014
Contents |
[edit] Design for ext4
- Ext3: default filesystem for many users, reputation of dependability & compatibility, leave existing ext3 users undisturbed, stable
- Scaling up to support large filesystems: Storage advancements, Increasing data storage requirements, only large filesystem users move to ext4
- Features requiring on-disk format change: nanosec timestamps, fast extent allocation, preallocation
- Reliability wrt on-disk corruption
- 64 bit JBD split
- Forward compatibility/upgradeability
- Multiblock allocation
- Delayed allocation
- 1st Class Quota Support (Implementation in progress)
- Large allocation blocks (Not yet implemented; in design phase)
[edit] Ext4 Extents
The core of the Ext4 FS is the support for extents. An extent is simply a set of blocks which are logically contiguous within the file and also on the underlying block device. Most contemporary filesystems put considerable effort into allocating contiguous blocks for files as a way of making I/O operations faster, so blocks which are logically contiguous within the file often are also contiguous on-disk. As a result, storing the file structure as extents should result in significant compression of the file's metadata, since a single extent can replace a large number of block pointers. The reduction in metadata should enable faster access as well.
[edit] On-Disk Structures
/* * This is the extent on-disk structure. * It's used at the bottom of the tree. */ struct ext4_extent { __le32 ee_block; /* first logical block extent covers */ __le16 ee_len; /* number of blocks covered by extent */ __le16 ee_start_hi; /* high 16 bits of physical block */ __le32 ee_start_lo; /* low 32 bits of physical block */ }; /* * This is index on-disk structure. * It's used at all the levels except the bottom. */ struct ext4_extent_idx { __le32 ei_block; /* index covers logical blocks from 'block' */ __le32 ei_leaf_lo; /* pointer to the physical block of the next * * level. leaf or next index could be there */ __le16 ei_leaf_hi; /* high 16 bits of physical block */ __u16 ei_unused; };