From d3226853339244d9acf3e57282dc023bbbc5228d Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Wed, 14 Jun 2023 16:15:06 +0800 Subject: [PATCH] mm/readahead: Fix for GKI Fixes: c73d891d8e6e ("mm: optimize readahead for the file with fscrypt") Signed-off-by: Tao Huang Change-Id: I1db7d429e5ce34330d5c2d6737b520d3b6779977 --- mm/readahead.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/readahead.c b/mm/readahead.c index 393fe69001ab..7bb2c3e59072 100644 --- a/mm/readahead.c +++ b/mm/readahead.c @@ -27,7 +27,7 @@ #include "internal.h" -#ifdef CONFIG_ARCH_ROCKCHIP +#if defined(CONFIG_ARCH_ROCKCHIP) && defined(CONFIG_NO_GKI) #include #endif @@ -291,7 +291,7 @@ void force_page_cache_ra(struct readahead_control *ractl, struct address_space *mapping = ractl->mapping; struct backing_dev_info *bdi = inode_to_bdi(mapping->host); unsigned long max_pages, index; -#ifdef CONFIG_ARCH_ROCKCHIP +#if defined(CONFIG_ARCH_ROCKCHIP) && defined(CONFIG_NO_GKI) bool force_lookahead = false; #endif @@ -305,7 +305,7 @@ void force_page_cache_ra(struct readahead_control *ractl, */ index = readahead_index(ractl); max_pages = max_t(unsigned long, bdi->io_pages, ra->ra_pages); -#ifdef CONFIG_ARCH_ROCKCHIP +#if defined(CONFIG_ARCH_ROCKCHIP) && defined(CONFIG_NO_GKI) /* For files with fscrypt enabled, to allow IO and the encryption * or decryption process to ping-pong, lookahead is forcibly enabled. */ @@ -319,7 +319,7 @@ void force_page_cache_ra(struct readahead_control *ractl, if (this_chunk > nr_to_read) this_chunk = nr_to_read; ractl->_index = index; -#ifdef CONFIG_ARCH_ROCKCHIP +#if defined(CONFIG_ARCH_ROCKCHIP) && defined(CONFIG_NO_GKI) if (force_lookahead) do_page_cache_ra(ractl, this_chunk, this_chunk / 2); else