]> www.infradead.org Git - users/hch/block.git/commit
mm: split swap_type_of
authorChristoph Hellwig <hch@lst.de>
Thu, 3 Sep 2020 10:20:15 +0000 (12:20 +0200)
committerChristoph Hellwig <hch@lst.de>
Sat, 19 Sep 2020 05:20:16 +0000 (07:20 +0200)
commit8785e0fd6f64ad344ee24e157373c9fb66ffa5e5
tree61ea262de0aa9b9f8611e0d029adf43ea3466c08
parentf80509ba70fa8c61a45d18a9a6b81c4ce192a648
mm: split swap_type_of

swap_type_of is used for two entirely different purposes:

 (1) check what swap type a given device/offset corresponds to
 (2) find the first available swap device that can be written to

Mixing both in a single function creates an unreadable mess.  Create two
separate functions instead, and switch both to pass a dev_t instead of
a struct block_device to further simplify the code.

Signed-off-by: Christoph Hellwig <hch@lst.de>
include/linux/swap.h
kernel/power/swap.c
kernel/power/user.c
mm/swapfile.c