ANDROID: Revert "mm: remove cleancache"
This reverts commit 0a4ee518185e902758191d968600399f3bc2be31.
Conflicts:
Documentation/mm/cleancache.rst
Documentation/vm/index.rst
arch/arm/configs/bcm2835_defconfig
arch/arm/configs/qcom_defconfig
arch/m68k/configs/amiga_defconfig
arch/m68k/configs/apollo_defconfig
arch/m68k/configs/atari_defconfig
arch/m68k/configs/bvme6000_defconfig
arch/m68k/configs/hp300_defconfig
arch/m68k/configs/mac_defconfig
arch/m68k/configs/multi_defconfig
arch/m68k/configs/mvme147_defconfig
arch/m68k/configs/mvme16x_defconfig
arch/m68k/configs/q40_defconfig
arch/m68k/configs/sun3_defconfig
arch/m68k/configs/sun3x_defconfig
arch/s390/configs/debug_defconfig
arch/s390/configs/defconfig
fs/f2fs/data.c
fs/mpage.c
1. Skip documentation which was refactored.
2. Skip defconfigs unused in Android.
3. Replaced deprecated __submit_bio() with f2fs_submit_read_bio()
4. Replaced PageUptodate() with folio_test_uptodate()
5. Replaced SetPageUptodate() with folio_mark_uptodate()
6. Changed cleancache_get_page() call to use folio->page
7. Changed ext4_mpage_readpages() to use folio instead of page
Bug: 271544708
Bug: 323283126
Change-Id: I93359509f7799de72f31b002a2539565d1bda9d6
Signed-off-by: Suren Baghdasaryan <[email protected]>
diff --git a/fs/mpage.c b/fs/mpage.c
index 242e213..b1ba706 100644
--- a/fs/mpage.c
+++ b/fs/mpage.c
@@ -29,6 +29,7 @@
#include <linux/writeback.h>
#include <linux/backing-dev.h>
#include <linux/pagevec.h>
+#include <linux/cleancache.h>
#include "internal.h"
/*
@@ -287,6 +288,12 @@ static struct bio *do_mpage_readpage(struct mpage_readpage_args *args)
folio_set_mappedtodisk(folio);
}
+ if (fully_mapped && blocks_per_page == 1 && !folio_test_uptodate(folio) &&
+ cleancache_get_page(&folio->page) == 0) {
+ folio_mark_uptodate(folio);
+ goto confused;
+ }
+
/*
* This folio will go to BIO. Do we need to send this BIO off first?
*/