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: remove SWAP_FLAG_PRIO_SHIFT

It doesn't make sense to have a zero value of shift. Remove it to avoid
confusion.

Link: https://lkml.kernel.org/r/20250205092721.9395-4-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
0eb7d2c3 cd57a3fb

+1 -3
-1
include/linux/swap.h
··· 24 24 25 25 #define SWAP_FLAG_PREFER 0x8000 /* set if swap priority specified */ 26 26 #define SWAP_FLAG_PRIO_MASK 0x7fff 27 - #define SWAP_FLAG_PRIO_SHIFT 0 28 27 #define SWAP_FLAG_DISCARD 0x10000 /* enable discard for swap */ 29 28 #define SWAP_FLAG_DISCARD_ONCE 0x20000 /* discard swap area at swapon-time */ 30 29 #define SWAP_FLAG_DISCARD_PAGES 0x40000 /* discard page-clusters after use */
+1 -2
mm/swapfile.c
··· 3453 3453 mutex_lock(&swapon_mutex); 3454 3454 prio = -1; 3455 3455 if (swap_flags & SWAP_FLAG_PREFER) 3456 - prio = 3457 - (swap_flags & SWAP_FLAG_PRIO_MASK) >> SWAP_FLAG_PRIO_SHIFT; 3456 + prio = swap_flags & SWAP_FLAG_PRIO_MASK; 3458 3457 enable_swap_info(si, prio, swap_map, cluster_info, zeromap); 3459 3458 3460 3459 pr_info("Adding %uk swap on %s. Priority:%d extents:%d across:%lluk %s%s%s%s\n",