summaryrefslogtreecommitdiff
path: root/mm/swap.h
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2022-09-02 20:46:15 +0100
committerAndrew Morton <akpm@linux-foundation.org>2022-10-03 14:02:48 -0700
commitc9edc242811d4c4b939b283f4f40b89f9c5b3b5a (patch)
tree9ac8298c3d6e062743f780e6bcca010b3be27686 /mm/swap.h
parent0d698e257241436e01182508d93fc290987eb37d (diff)
swap: add swap_cache_get_folio()
Convert lookup_swap_cache() into swap_cache_get_folio() and add a lookup_swap_cache() wrapper around it. [akpm@linux-foundation.org: add CONFIG_SWAP=n stub for swap_cache_get_folio()] Link: https://lkml.kernel.org/r/20220902194653.1739778-20-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/swap.h')
-rw-r--r--mm/swap.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/mm/swap.h b/mm/swap.h
index 29e38f3d82d0..ccd8d9a9ad36 100644
--- a/mm/swap.h
+++ b/mm/swap.h
@@ -39,6 +39,8 @@ void __delete_from_swap_cache(struct folio *folio,
void delete_from_swap_cache(struct folio *folio);
void clear_shadow_from_swap_cache(int type, unsigned long begin,
unsigned long end);
+struct folio *swap_cache_get_folio(swp_entry_t entry,
+ struct vm_area_struct *vma, unsigned long addr);
struct page *lookup_swap_cache(swp_entry_t entry,
struct vm_area_struct *vma,
unsigned long addr);
@@ -99,6 +101,12 @@ static inline int swap_writepage(struct page *p, struct writeback_control *wbc)
return 0;
}
+static inline struct folio *swap_cache_get_folio(swp_entry_t entry,
+ struct vm_area_struct *vma, unsigned long addr)
+{
+ return NULL;
+}
+
static inline struct page *lookup_swap_cache(swp_entry_t swp,
struct vm_area_struct *vma,
unsigned long addr)