mm/readahead: Fix for GKI
Fixes: c73d891d8e ("mm: optimize readahead for the file with fscrypt")
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I1db7d429e5ce34330d5c2d6737b520d3b6779977
This commit is contained in:
parent
73b5dde370
commit
d322685333
|
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
|
|
||||||
#ifdef CONFIG_ARCH_ROCKCHIP
|
#if defined(CONFIG_ARCH_ROCKCHIP) && defined(CONFIG_NO_GKI)
|
||||||
#include <linux/fscrypt.h>
|
#include <linux/fscrypt.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -291,7 +291,7 @@ void force_page_cache_ra(struct readahead_control *ractl,
|
||||||
struct address_space *mapping = ractl->mapping;
|
struct address_space *mapping = ractl->mapping;
|
||||||
struct backing_dev_info *bdi = inode_to_bdi(mapping->host);
|
struct backing_dev_info *bdi = inode_to_bdi(mapping->host);
|
||||||
unsigned long max_pages, index;
|
unsigned long max_pages, index;
|
||||||
#ifdef CONFIG_ARCH_ROCKCHIP
|
#if defined(CONFIG_ARCH_ROCKCHIP) && defined(CONFIG_NO_GKI)
|
||||||
bool force_lookahead = false;
|
bool force_lookahead = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -305,7 +305,7 @@ void force_page_cache_ra(struct readahead_control *ractl,
|
||||||
*/
|
*/
|
||||||
index = readahead_index(ractl);
|
index = readahead_index(ractl);
|
||||||
max_pages = max_t(unsigned long, bdi->io_pages, ra->ra_pages);
|
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
|
/* For files with fscrypt enabled, to allow IO and the encryption
|
||||||
* or decryption process to ping-pong, lookahead is forcibly enabled.
|
* 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)
|
if (this_chunk > nr_to_read)
|
||||||
this_chunk = nr_to_read;
|
this_chunk = nr_to_read;
|
||||||
ractl->_index = index;
|
ractl->_index = index;
|
||||||
#ifdef CONFIG_ARCH_ROCKCHIP
|
#if defined(CONFIG_ARCH_ROCKCHIP) && defined(CONFIG_NO_GKI)
|
||||||
if (force_lookahead)
|
if (force_lookahead)
|
||||||
do_page_cache_ra(ractl, this_chunk, this_chunk / 2);
|
do_page_cache_ra(ractl, this_chunk, this_chunk / 2);
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue