fs: ext4: cache extent data
authorStephen Warren <swarren@nvidia.com>
Wed, 30 Jan 2019 19:58:05 +0000 (12:58 -0700)
committerTom Rini <trini@konsulko.com>
Tue, 9 Apr 2019 19:34:15 +0000 (15:34 -0400)
commitd5aee659f217746395ff58adf3a863627ff02ec1
tree2d2db84b18244673371c5478fbb365560cdb071a
parent4c24dab391003b99b1e0784fd41fe756cb07039e
fs: ext4: cache extent data

When a file contains extents, U-Boot currently reads extent-related data
for each block in the file, even if that data is located in the same
block each time. This significantly slows down loading of files that use
extents. Implement a very dumb cache to prevent repeatedly reading the
same block. Files with extents now load as fast as files without.

Note: There are many cases where read_allocated_block() is called. This
patch only addresses one of those places; all others still read redundant
data in any case they did before. This is a minimal patch to fix the
load command; other cases aren't fixed.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
fs/ext4/ext4_common.c
fs/ext4/ext4_journal.c
fs/ext4/ext4_write.c
fs/ext4/ext4fs.c
include/ext4fs.h