]> err.no Git - linux-2.6/blobdiff - include/linux/swapops.h
Merge git://git.infradead.org/mtd-2.6
[linux-2.6] / include / linux / swapops.h
index ceb6cc5ceebbee56b69107daad587c512987794f..7bf2d149d209615be247da2dadc4385f37636be5 100644 (file)
@@ -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.