Squashfs: optimize reading uncompressed data
authorAdrien Schildknecht <adriens@google.com>
Thu, 29 Sep 2016 22:25:30 +0000 (15:25 -0700)
committerAmit Pundir <amit.pundir@linaro.org>
Mon, 10 Apr 2017 07:42:16 +0000 (13:12 +0530)
commit0c2f831ee7b27dc478a3362f6743d0013c8bdd73
tree482c662bcf10a706508391143673a626ff9cdac2
parent9c6d9abc8fa9d5207da81d4f7bb14b9c315e11e7
Squashfs: optimize reading uncompressed data

When dealing with uncompressed data, there is no need to read a whole
block (default 128K) to get the desired page: the pages are
independent from each others.

This patch change the readpages logic so that reading uncompressed
data only read the number of pages advised by the readahead algorithm.

Moreover, if the page actor contains holes (i.e. pages that are already
up-to-date), squashfs skips the buffer_head associated to those pages.

This patch greatly improve the performance of random reads for
uncompressed files because squashfs only read what is needed. It also
reduces the number of unnecessary reads.

Signed-off-by: Adrien Schildknecht <adriens@google.com>
Change-Id: I1850150fbf4b45c9dd138d88409fea1ab44054c0
fs/squashfs/block.c
fs/squashfs/file_direct.c