squashfs: implement readahead
authorHsin-Yi Wang <hsinyi@chromium.org>
Fri, 17 Jun 2022 08:38:13 +0000 (16:38 +0800)
committerakpm <akpm@linux-foundation.org>
Sat, 30 Jul 2022 01:12:34 +0000 (18:12 -0700)
commit8fc78b6fe24c36b151ac98d7546591ed92083d4f
tree76c29ca47f54977207b0dbe0301b5c9cd017038f
parentdb98b43086275350294f5c6f797249b714d6316d
squashfs: implement readahead

Implement readahead callback for squashfs.  It will read datablocks which
cover pages in readahead request.  For a few cases it will not mark page
as uptodate, including:

- file end is 0.
- zero filled blocks.
- current batch of pages isn't in the same datablock.
- decompressor error.

Otherwise pages will be marked as uptodate.  The unhandled pages will be
updated by readpage later.

Link: https://lkml.kernel.org/r/20220617083810.337573-4-hsinyi@chromium.org
Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Suggested-by: Matthew Wilcox <willy@infradead.org>
Reported-by: Matthew Wilcox <willy@infradead.org>
Reported-by: Phillip Lougher <phillip@squashfs.org.uk>
Reported-by: Xiongwei Song <Xiongwei.Song@windriver.com>
Reported-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Hou Tao <houtao1@huawei.com>
Cc: kernel test robot <lkp@intel.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Miao Xie <miaoxie@huawei.com>
Cc: Zhang Yi <yi.zhang@huawei.com>
Cc: Zheng Liang <zhengliang6@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/squashfs/file.c