lkml.org 
[lkml]   [2022]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] mm/swap: simplify the code of find_get_incore_page()
Date
pagecache_get_page() can return subpage for us if we do not specify
FGP_HEAD. No functional change intended.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
mm/swap_state.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/mm/swap_state.c b/mm/swap_state.c
index ee67164531c0..517b4b856e32 100644
--- a/mm/swap_state.c
+++ b/mm/swap_state.c
@@ -394,13 +394,10 @@ struct page *find_get_incore_page(struct address_space *mapping, pgoff_t index)
{
swp_entry_t swp;
struct swap_info_struct *si;
- struct page *page = pagecache_get_page(mapping, index,
- FGP_ENTRY | FGP_HEAD, 0);
+ struct page *page = pagecache_get_page(mapping, index, FGP_ENTRY, 0);

- if (!page)
+ if (!page || !xa_is_value(page))
return page;
- if (!xa_is_value(page))
- return find_subpage(page, index);
if (!shmem_mapping(mapping))
return NULL;

--
2.23.0
\
 
 \ /
  Last update: 2022-09-17 16:17    [W:0.307 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site