summaryrefslogtreecommitdiff
path: root/include/linux/swapops.h
diff options
context:
space:
mode:
authorMatt Mackall <mpm@selenic.com>2008-02-04 22:29:00 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-05 09:44:16 -0800
commit698dd4ba6b12e34e1e432c944c01478c0b2cd773 (patch)
treefe524e3ae12b54968b363314ad45841abbd55d98 /include/linux/swapops.h
parent824552574162ac00ae636fa41386b1072379ea4a (diff)
maps4: move is_swap_pte
Move is_swap_pte helper function to swapops.h for use by pagemap code Signed-off-by: Matt Mackall <mpm@selenic.com> Cc: Dave Hansen <haveblue@us.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
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 ceb6cc5ceeb..7bf2d149d20 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.