Kairui Song cbc2bd98db swap: avoid holding swap reference in swap_cache_get_folio
All its callers either already hold a reference to, or lock the swap
device while calling this function.  There is only one exception in
shmem_swapin_folio, just make this caller also hold a reference of the
swap device, so this helper can be simplified and saves a few cycles.

This also provides finer control of error handling in shmem_swapin_folio,
on race (with swap off), it can just try again.  For invalid swap entry,
it can fail with a proper error code.

Link: https://lkml.kernel.org/r/20221219185840.25441-5-ryncsn@gmail.com
Signed-off-by: Kairui Song <kasong@tencent.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: "Huang, Ying" <ying.huang@intel.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Miaohe Lin <linmiaohe@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-01-18 17:12:45 -08:00
..
2022-12-14 12:20:00 -08:00
2022-12-21 14:31:52 -08:00
2021-05-05 11:27:24 -07:00
2022-12-17 14:06:53 -06:00
2022-09-26 19:46:16 -07:00
2022-12-17 14:06:53 -06:00
2022-11-27 23:38:02 +01:00
2022-10-03 14:02:43 -07:00
2022-09-26 19:46:09 -07:00
2023-01-11 16:14:23 -08:00
2023-01-18 17:12:40 -08:00
2021-05-07 00:26:35 -07:00
2023-01-18 17:12:42 -08:00
2022-12-14 12:20:00 -08:00
2022-12-13 19:29:45 -08:00
2022-12-17 14:06:53 -06:00
2022-12-11 18:12:10 -08:00
2022-12-11 18:12:10 -08:00
2022-12-11 18:12:10 -08:00