summaryrefslogtreecommitdiffstats
path: root/mm/swapfile.c
diff options
context:
space:
mode:
authorWei Yang <richard.weiyang@gmail.com>2020-06-02 06:49:16 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2020-06-02 19:59:09 +0200
commit33e16272fe982084e986d4eb6d5b5ca51c0d214e (patch)
tree5b8c8c26d3efb69e4e445f71903aaea8ef69397f /mm/swapfile.c
parentmm/swapfile.c: classify SWAP_MAP_XXX to make it more readable (diff)
downloadlinux-33e16272fe982084e986d4eb6d5b5ca51c0d214e.tar.xz
linux-33e16272fe982084e986d4eb6d5b5ca51c0d214e.zip
mm/swapfile.c: __swap_entry_free() always free 1 entry
__swap_entry_free() always frees 1 entry. Let's remove the usage. Signed-off-by: Wei Yang <richard.weiyang@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Link: http://lkml.kernel.org/r/20200501015259.32237-2-richard.weiyang@gmail.com Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/swapfile.c')
-rw-r--r--mm/swapfile.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c
index b365cbe99cc3..2aa272376cae 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -1273,13 +1273,14 @@ unlock_out:
}
static unsigned char __swap_entry_free(struct swap_info_struct *p,
- swp_entry_t entry, unsigned char usage)
+ swp_entry_t entry)
{
struct swap_cluster_info *ci;
unsigned long offset = swp_offset(entry);
+ unsigned char usage;
ci = lock_cluster_or_swap_info(p, offset);
- usage = __swap_entry_free_locked(p, offset, usage);
+ usage = __swap_entry_free_locked(p, offset, 1);
unlock_cluster_or_swap_info(p, ci);
if (!usage)
free_swap_slot(entry);
@@ -1314,7 +1315,7 @@ void swap_free(swp_entry_t entry)
p = _swap_info_get(entry);
if (p)
- __swap_entry_free(p, entry, 1);
+ __swap_entry_free(p, entry);
}
/*
@@ -1737,7 +1738,7 @@ int free_swap_and_cache(swp_entry_t entry)
p = _swap_info_get(entry);
if (p) {
- count = __swap_entry_free(p, entry, 1);
+ count = __swap_entry_free(p, entry);
if (count == SWAP_HAS_CACHE &&
!swap_page_trans_huge_swapped(p, entry))
__try_to_reclaim_swap(p, swp_offset(entry),