History

ext4: add support for extent pre-caching

Add a new fiemap flag which forces the all of the extents in an inode to be cached in the extent_status tree. This is critically important when using AIO to a preallocated file, since if we need to read in blocks from the extent tree, the io_submit(2) system call becomes synchronous, and the AIO is no longer "A", which is bad. In addition, for most files which have an external leaf tree block, the cost of caching the information in the extent status tree will be less than caching the entire 4k block in the buffer cache. So it is generally a win to keep the extent information cached.

Theodore Ts'o committed 13 years ago

Commit 7869a4a1 parent 107a7bd5 files · +137 −29Browse files

Showing the changes to include/uapi/linux (1 of 5 files). Show all

Unified · Split

include/uapi/linux/fiemap.h+1−0
@@ -40,6 +40,7 @@ struct fiemap { · 39 unmodified lines
4040
4141 #define FIEMAP_FLAG_SYNC 0x00000001 /* sync file data before map */
4242 #define FIEMAP_FLAG_XATTR 0x00000002 /* map extended attribute tree */
43+#define FIEMAP_FLAG_CACHE 0x00000004 /* request caching of the extents */
4344
4445 #define FIEMAP_FLAGS_COMPAT (FIEMAP_FLAG_SYNC | FIEMAP_FLAG_XATTR)
4546