Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm/swap: rename swap_is_has_cache() to swap_only_has_cache()

There are two predicates in the name of swap_is_has_cache() which is
confusing. Renaming it to remove the confusion and can better reflect its
functionality.

Link: https://lkml.kernel.org/r/20250205092721.9395-6-bhe@redhat.com
Signed-off-by: Baoquan He <bhe@redhat.com>
Cc: Chris Li <chrisl@kernel.org>
Cc: Kairui Song <ryncsn@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Baoquan He and committed by
Andrew Morton
b4735d94 9b9cba72

+3 -3
+3 -3
mm/swapfile.c
··· 161 161 /* Reclaim directly, bypass the slot cache and don't touch device lock */ 162 162 #define TTRS_DIRECT 0x8 163 163 164 - static bool swap_is_has_cache(struct swap_info_struct *si, 164 + static bool swap_only_has_cache(struct swap_info_struct *si, 165 165 unsigned long offset, int nr_pages) 166 166 { 167 167 unsigned char *map = si->swap_map + offset; ··· 243 243 * reference or pending writeback, and can't be allocated to others. 244 244 */ 245 245 ci = lock_cluster(si, offset); 246 - need_reclaim = swap_is_has_cache(si, offset, nr_pages); 246 + need_reclaim = swap_only_has_cache(si, offset, nr_pages); 247 247 unlock_cluster(ci); 248 248 if (!need_reclaim) 249 249 goto out_unlock; ··· 1577 1577 return; 1578 1578 1579 1579 ci = lock_cluster(si, offset); 1580 - if (swap_is_has_cache(si, offset, size)) 1580 + if (swap_only_has_cache(si, offset, size)) 1581 1581 swap_entry_range_free(si, ci, entry, size); 1582 1582 else { 1583 1583 for (int i = 0; i < size; i++, entry.val++) {