mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 03:04:51 +01:00
mm/swap_state.c: optimize the code in clear_shadow_from_swap_cache()
Use ALIGN to achieve the same effect and simplify the code. Link: https://lkml.kernel.org/r/20250205092721.9395-3-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>
This commit is contained in:
parent
81fe88a946
commit
cd57a3fb37
1 changed files with 1 additions and 3 deletions
|
|
@ -270,9 +270,7 @@ void clear_shadow_from_swap_cache(int type, unsigned long begin,
|
|||
xa_unlock_irq(&address_space->i_pages);
|
||||
|
||||
/* search the next swapcache until we meet end */
|
||||
curr >>= SWAP_ADDRESS_SPACE_SHIFT;
|
||||
curr++;
|
||||
curr <<= SWAP_ADDRESS_SPACE_SHIFT;
|
||||
curr = ALIGN((curr + 1), SWAP_ADDRESS_SPACE_PAGES);
|
||||
if (curr > end)
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue