From: u-boot@lakedaemon.net Date: Wed, 28 Mar 2012 04:37:11 +0000 (+0000) Subject: ext2load: increase read speed X-Git-Tag: submit/tizen/20160318.071304~488 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=22efc31a328782ebdc9503dade79173cb76ab238;p=profile%2Fcommon%2Fplatform%2Fkernel%2Fu-boot-artik.git ext2load: increase read speed 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 Tested-by: Eric Nelson Tested-by: Thierry Reding Conflicts: fs/ext2/ext2fs.c --- diff --git a/fs/ext2/ext2fs.c b/fs/ext2/ext2fs.c index 182f0acac..f1fce48a3 100644 --- a/fs/ext2/ext2fs.c +++ b/fs/ext2/ext2fs.c @@ -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) {