The Linux kernel's iomap layer
9 hours ago
- #I/O-mapping
- #kernel-filesystem
- #iomap
- The iomap code, first introduced in Linux kernel 4.8, replaced buffer heads for efficient I/O with large files and extent-based filesystems.
- iomap uses a single iomap structure to map file ranges to storage, with types like IOMAP_MAPPED for normal storage and IOMAP_HOLE for unallocated ranges.
- Filesystems implement iomap via callbacks (iomap_begin and iomap_end) to handle I/O operations such as reads, writes, and zeroing.
- iomap simplifies filesystem I/O implementation, providing functions like iomap_read_folio for buffered reads and iomap_writepages for writes.
- The subsystem supports various operations including direct I/O, DAX, file truncation, and is under active development with new features and filesystem conversions.