]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm: swap: replace cluster_swap_free_nr() with swap_entries_put_[map/cache]()
authorKemeng Shi <shikemeng@huaweicloud.com>
Tue, 25 Mar 2025 16:25:28 +0000 (00:25 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 12 May 2025 00:48:14 +0000 (17:48 -0700)
commitec9827cd28b13b88517812eb08b13d0ed97ae8f1
tree1e9717f8ee1dfd426fe03eef7c1416bd25a5312e
parentd4f8000bd6b0cc33c9dddd369e72a13c4c080cb1
mm: swap: replace cluster_swap_free_nr() with swap_entries_put_[map/cache]()

Replace cluster_swap_free_nr() with swap_entries_put_[map/cache]() to
remove repeat code and leverage batch-remove for entries with last flag.
After removing cluster_swap_free_nr, only functions with "_nr" suffix
could free entries spanning cross clusters.  Add corresponding description
in comment of swap_entries_put_map_nr() as is first function with "_nr"
suffix and have a non-suffix variant function swap_entries_put_map().

Link: https://lkml.kernel.org/r/20250325162528.68385-9-shikemeng@huaweicloud.com
Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
Reviewed-by: Tim Chen <tim.c.chen@linux.intel.com>
Reviewed-by: Baoquan He <bhe@redhat.com>
Cc: Kairui Song <kasong@tencent.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/swapfile.c