mbox series

[0/3] Cleanup scan_swap_map_slots() a little

Message ID 20200328060520.31449-1-richard.weiyang@gmail.com (mailing list archive)
Headers show
Series Cleanup scan_swap_map_slots() a little | expand

Message

Wei Yang March 28, 2020, 6:05 a.m. UTC
Function scan_swap_map_slots() is used to iterate swap_map[] array for an
available swap entry. While after several optimizations, e.g. for ssd case,
the logic of this function is a little not easy to catch.

This patch set tries to clean up the logic a little:

  * shows the ssd/non-ssd case is handled mutually exclusively
  * remove some unnecessary goto for ssd case

Wei Yang (3):
  mm/swapfile.c: offset is only used when there is more slots
  mm/swapfile.c: explicitly show ssd/non-ssd is handled mutually
    exclusive
  mm/swapfile.c: remove the unnecessary goto for SSD case

 mm/swapfile.c | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)