From: Matt Mackall Date: Tue, 5 Feb 2008 06:29:00 +0000 (-0800) Subject: maps4: move is_swap_pte X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=698dd4ba6b12e34e1e432c944c01478c0b2cd773;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git maps4: move is_swap_pte Move is_swap_pte helper function to swapops.h for use by pagemap code Signed-off-by: Matt Mackall Cc: Dave Hansen Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/include/linux/swapops.h b/include/linux/swapops.h index ceb6cc5ceebb..7bf2d149d209 100644 --- a/include/linux/swapops.h +++ b/include/linux/swapops.h @@ -42,6 +42,12 @@ static inline pgoff_t swp_offset(swp_entry_t entry) return entry.val & SWP_OFFSET_MASK(entry); } +/* check whether a pte points to a swap entry */ +static inline int is_swap_pte(pte_t pte) +{ + return !pte_none(pte) && !pte_present(pte) && !pte_file(pte); +} + /* * Convert the arch-dependent pte representation of a swp_entry_t into an * arch-independent swp_entry_t. diff --git a/mm/migrate.c b/mm/migrate.c index 6a207e8d17ea..4ee4ccacf986 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -115,11 +115,6 @@ int putback_lru_pages(struct list_head *l) return count; } -static inline int is_swap_pte(pte_t pte) -{ - return !pte_none(pte) && !pte_present(pte) && !pte_file(pte); -} - /* * Restore a potential migration pte to a working pte entry */