]> git.baikalelectronics.ru Git - kernel.git/commit
shmem: convert shmem_replace_page() to use folios throughout
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Fri, 2 Sep 2022 19:46:04 +0000 (20:46 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 3 Oct 2022 21:02:45 +0000 (14:02 -0700)
commit9b7e873e7a5cde0f3f3ebecff0f2f0bf7c9971bc
tree5050dd659c8644d6a267b2663a5e40b8659d1650
parent02508cf49eab75e1563f4a6ca7fa79e8b4e4c9d5
shmem: convert shmem_replace_page() to use folios throughout

Introduce folio_set_swap_entry() to abstract how both folio->private and
swp_entry_t work.  Use swap_address_space() directly instead of
indirecting through folio_mapping().  Include an assertion that the old
folio is not large as we only allocate a single-page folio to replace it.
Use folio_put_refs() instead of calling folio_put() twice.

Link: https://lkml.kernel.org/r/20220902194653.1739778-9-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/swap.h
mm/shmem.c