summaryrefslogtreecommitdiff
path: root/mm/swap_state.c
diff options
context:
space:
mode:
authorHuang Ying <ying.huang@intel.com>2023-05-29 09:13:53 +0300
committerAndrew Morton <akpm@linux-foundation.org>2023-06-10 02:25:49 +0300
commit3ecdeb0f876e91c4a7129ba2ba5baa530aa6c4f9 (patch)
treefb774a8ead845b889170e7cbd50f6407402c30c9 /mm/swap_state.c
parent46a774d3eae523fd9a1907ba90e9a116cd1c5ddc (diff)
downloadlinux-3ecdeb0f876e91c4a7129ba2ba5baa530aa6c4f9.tar.xz
swap: remove __swp_swapcount()
__swp_swapcount() just encloses the calling to swap_swapcount() with get/put_swap_device(). It is called in __read_swap_cache_async() only, which encloses the calling with get/put_swap_device() already. So, __read_swap_cache_async() can call swap_swapcount() directly. Link: https://lkml.kernel.org/r/20230529061355.125791-4-ying.huang@intel.com Signed-off-by: "Huang, Ying" <ying.huang@intel.com> Reviewed-by: David Hildenbrand <david@redhat.com> Reviewed-by: Chris Li (Google) <chrisl@kernel.org> Cc: Hugh Dickins <hughd@google.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Matthew Wilcox <willy@infradead.org> Cc: Michal Hocko <mhocko@suse.com> Cc: Minchan Kim <minchan@kernel.org> Cc: Tim Chen <tim.c.chen@linux.intel.com> Cc: Yang Shi <shy828301@gmail.com> Cc: Yu Zhao <yuzhao@google.com> Cc: Yosry Ahmed <yosryahmed@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/swap_state.c')
-rw-r--r--mm/swap_state.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/swap_state.c b/mm/swap_state.c
index a8450b4a110c..ef32353c18a6 100644
--- a/mm/swap_state.c
+++ b/mm/swap_state.c
@@ -447,7 +447,7 @@ struct page *__read_swap_cache_async(swp_entry_t entry, gfp_t gfp_mask,
* as SWAP_HAS_CACHE. That's done in later part of code or
* else swap_off will be aborted if we return NULL.
*/
- if (!__swp_swapcount(entry) && swap_slot_cache_enabled)
+ if (!swap_swapcount(si, entry) && swap_slot_cache_enabled)
goto fail_put_swap;
/*