aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Mackall <mpm@selenic.com>2008-02-05 01:29:00 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-05 12:44:16 -0500
commit698dd4ba6b12e34e1e432c944c01478c0b2cd773 (patch)
treefe524e3ae12b54968b363314ad45841abbd55d98
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>
-rw-r--r--include/linux/swapops.h6
-rw-r--r--mm/migrate.c5
2 files changed, 6 insertions, 5 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.
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)
115 return count; 115 return count;
116} 116}
117 117
118static inline int is_swap_pte(pte_t pte)
119{
120 return !pte_none(pte) && !pte_present(pte) && !pte_file(pte);
121}
122
123/* 118/*
124 * Restore a potential migration pte to a working pte entry 119 * Restore a potential migration pte to a working pte entry
125 */ 120 */