ext2load: increase read speed
authoru-boot@lakedaemon.net <u-boot@lakedaemon.net>
Wed, 28 Mar 2012 04:37:11 +0000 (04:37 +0000)
committerChanho Park <chanho61.park@samsung.com>
Wed, 22 Jul 2015 10:47:24 +0000 (19:47 +0900)
This patch dramatically drops the amount of time u-boot needs to read a
file from an ext2 partition.  On a typical 2 to 5 MB file (kernels and
initrds) it goes from tens of seconds to a couple seconds.

All we are doing here is grouping contiguous blocks into one read.

Boot tested on Globalscale Technologies Dreamplug (Kirkwood ARM SoC)
with three different files.  sha1sums were calculated in Linux
userspace, and then confirmed after ext2load.

Signed-off-by: Jason Cooper <u-boot@lakedaemon.net>
Tested-by: Eric Nelson <eric.nelson@boundarydevices.com>
Tested-by: Thierry Reding <thierry.reding@avionic-design.de>
Conflicts:
fs/ext2/ext2fs.c

fs/ext2/ext2fs.c

index 182f0acacaeda50e106d6161706503a413f5c63a..f1fce48a3920d3ed1220005911ac2092a441f248 100644 (file)
@@ -438,7 +438,7 @@ int ext2fs_read_file
                }
 
                /* grab middle blocks in one go */
-               if (i != pos / blocksize && i < blockcnt - 1 && blockcnt > 3) {
+               if (i != pos / blocksize && i != blockcnt - 1 && blockcnt > 3) {
                        int oldblk = blknr;
                        int blocknxt;
                        while (i < blockcnt - 1) {