[PATCH 15/16] squashfs: use folio_end_read() for cached folios in squashfs_bio_read_cached()
From: Tal Zussman
Date: Tue Nov 03 2026 - 10:51:19 EST
Finish the folios added to the cache mapping with folio_end_read()
instead of marking them uptodate and unlocking by hand. No functional
change.
Signed-off-by: Tal Zussman <tz2294@xxxxxxxxxxxx>
---
fs/squashfs/block.c | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/fs/squashfs/block.c b/fs/squashfs/block.c
index 2d5850168026..3c81999ae441 100644
--- a/fs/squashfs/block.c
+++ b/fs/squashfs/block.c
@@ -153,11 +153,8 @@ static int squashfs_bio_read_cached(struct bio *fullbio,
read_start >> PAGE_SHIFT,
GFP_NOIO);
- if (!ret) {
- folio_mark_uptodate(head_to_cache);
- folio_unlock(head_to_cache);
- }
-
+ if (!ret)
+ folio_end_read(head_to_cache, true);
}
if (tail_to_cache) {
@@ -165,10 +162,8 @@ static int squashfs_bio_read_cached(struct bio *fullbio,
(read_end >> PAGE_SHIFT) - 1,
GFP_NOIO);
- if (!ret) {
- folio_mark_uptodate(tail_to_cache);
- folio_unlock(tail_to_cache);
- }
+ if (!ret)
+ folio_end_read(tail_to_cache, true);
}
#ifdef CONFIG_SQUASHFS_COMP_CACHE_FULL
@@ -182,10 +177,8 @@ static int squashfs_bio_read_cached(struct bio *fullbio,
(read_start >> PAGE_SHIFT) + idx,
GFP_NOIO);
- if (!ret) {
- folio_mark_uptodate(cache_folios[idx]);
- folio_unlock(cache_folios[idx]);
- }
+ if (!ret)
+ folio_end_read(cache_folios[idx], true);
}
kfree(cache_folios);
out:
--
2.39.5