summaryrefslogtreecommitdiff
path: root/include/linux/swap.h
diff options
context:
space:
mode:
authorMatthew Wilcox <willy@infradead.org>2023-08-21 18:08:47 +0200
committerAndrew Morton <akpm@linux-foundation.org>2023-08-24 16:20:28 -0700
commit85a1333417a7561c1d10a77d6c873a37e6ea63a0 (patch)
tree148d430e6fa824c59aedca49b711d7fd5f792cce /include/linux/swap.h
parentcfeed8ffe55b37fa10286aaaa1369da00cb88440 (diff)
mm/swap: use dedicated entry for swap in folio
Let's stop working on the private field and use an explicit swap field. We have to move the swp_entry_t typedef. Link: https://lkml.kernel.org/r/20230821160849.531668-3-david@redhat.com Signed-off-by: Matthew Wilcox <willy@infradead.org> Signed-off-by: David Hildenbrand <david@redhat.com> Reviewed-by: Chris Li <chrisl@kernel.org> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Dan Streetman <ddstreet@ieee.org> Cc: Hugh Dickins <hughd@google.com> Cc: Peter Xu <peterx@redhat.com> Cc: Seth Jennings <sjenning@redhat.com> Cc: Vitaly Wool <vitaly.wool@konsulko.com> Cc: Will Deacon <will@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include/linux/swap.h')
-rw-r--r--include/linux/swap.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/include/linux/swap.h b/include/linux/swap.h
index e5cf58a1cf9e..352eca0a75bc 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -335,8 +335,7 @@ struct swap_info_struct {
static inline swp_entry_t folio_swap_entry(struct folio *folio)
{
- swp_entry_t entry = { .val = page_private(&folio->page) };
- return entry;
+ return folio->swap;
}
static inline swp_entry_t page_swap_entry(struct page *page)
@@ -350,7 +349,7 @@ static inline swp_entry_t page_swap_entry(struct page *page)
static inline void folio_set_swap_entry(struct folio *folio, swp_entry_t entry)
{
- folio->private = (void *)entry.val;
+ folio->swap = entry;
}
/* linux/mm/workingset.c */