X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=include%2Flinux%2Fswapops.h;h=6ec39ab27b4b48aaf31b02a19bf5a164217abcce;hb=86665c75da41889f92b774f31ea5a9a436f392a8;hp=ceb6cc5ceebbee56b69107daad587c512987794f;hpb=a22a0fab32e1216df56e4b9a577dc5c922cf7524;p=pandora-kernel.git diff --git a/include/linux/swapops.h b/include/linux/swapops.h index ceb6cc5ceebb..6ec39ab27b4b 100644 --- a/include/linux/swapops.h +++ b/include/linux/swapops.h @@ -42,6 +42,14 @@ static inline pgoff_t swp_offset(swp_entry_t entry) return entry.val & SWP_OFFSET_MASK(entry); } +#ifdef CONFIG_MMU +/* 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); +} +#endif + /* * Convert the arch-dependent pte representation of a swp_entry_t into an * arch-independent swp_entry_t.