aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/swapops.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/swapops.h')
-rw-r--r--include/linux/swapops.h6
1 files changed, 6 insertions, 0 deletions
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)
42 return entry.val & SWP_OFFSET_MASK(entry); 42 return entry.val & SWP_OFFSET_MASK(entry);
43} 43}
44 44
45/* check whether a pte points to a swap entry */
46static inline int is_swap_pte(pte_t pte)
47{
48 return !pte_none(pte) && !pte_present(pte) && !pte_file(pte);
49}
50
45/* 51/*
46 * Convert the arch-dependent pte representation of a swp_entry_t into an 52 * Convert the arch-dependent pte representation of a swp_entry_t into an
47 * arch-independent swp_entry_t. 53 * arch-independent swp_entry_t.