u-boot/fs
Ionut Nicu fc0fc50f38 ext4fs: Add ext4 extent cache for read operations
In an ext4 filesystem, the inode corresponding to a file has a 60-byte
area which contains an extent header structure and up to 4 extent
structures (5 x 12 bytes).

For files that need more than 4 extents to be represented (either files
larger than 4 x 128MB = 512MB or smaller files but very fragmented),
ext4 creates extent index structures. Each extent index points to a 4KB
physical block where one extent header and additional 340 extents could
be stored.

The current u-boot ext4 code is very inefficient when it tries to load a
file which has extent indexes. For each logical file block the code will
read over and over again the same blocks of 4096 bytes from the disk.

Since the extent tree in a file is always the same, we can cache the
extent structures in memory before actually starting to read the file.

This patch creates a simple linked list of structures holding information
about all the extents used to represent a file. The list is sorted by
the logical block number (ee_block) so that we can easily find the
proper extent information for any file block.

Without this patch, a 69MB file which had just one extent index pointing
to a block with another 6 extents was read in approximately 3 minutes.
With this patch applied the same file can be read in almost 20 seconds.

Signed-off-by: Ionut Nicu <ioan.nicu.ext@nsn.com>
2014-02-21 11:33:18 -05:00
..
cbfs fs: descend into sub directories when it is necessary 2013-11-17 14:11:34 -05:00
cramfs fs: descend into sub directories when it is necessary 2013-11-17 14:11:34 -05:00
ext4 ext4fs: Add ext4 extent cache for read operations 2014-02-21 11:33:18 -05:00
fat fat: implement exists() for FAT fs 2014-02-19 09:47:34 -05:00
jffs2 JFFS2: Correct jffs2_1pass_build_lists to use lldiv 2013-12-13 09:16:20 -05:00
reiserfs fs: descend into sub directories when it is necessary 2013-11-17 14:11:34 -05:00
sandbox sandbox: implement exists() function 2014-02-19 09:47:34 -05:00
ubifs kbuild: use Linux Kernel build scripts 2014-02-19 11:07:50 -05:00
yaffs2 kbuild: use Linux Kernel build scripts 2014-02-19 11:07:50 -05:00
zfs fs: descend into sub directories when it is necessary 2013-11-17 14:11:34 -05:00
fs.c fat: implement exists() for FAT fs 2014-02-19 09:47:34 -05:00
Makefile fs/fdos: Remove 2014-02-21 08:42:47 -05:00