diff options
Diffstat (limited to 'include/linux/swapops.h')
-rw-r--r-- | include/linux/swapops.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/swapops.h b/include/linux/swapops.h index cd42e30b7c6..436a327d803 100644 --- a/include/linux/swapops.h +++ b/include/linux/swapops.h @@ -76,6 +76,14 @@ static inline pte_t swp_entry_to_pte(swp_entry_t entry) return __swp_entry_to_pte(arch_entry); } +static inline swp_entry_t page_swp_entry(struct page *page) +{ + swp_entry_t entry; + VM_BUG_ON(!PageSwapCache(page)); + entry.val = page_private(page); + return entry; +} + #ifdef CONFIG_MIGRATION static inline swp_entry_t make_migration_entry(struct page *page, int write) { |