X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=include%2Flinux%2Fswapops.h;h=6ec39ab27b4b48aaf31b02a19bf5a164217abcce;hb=f1b134fdf6d36c975b4a66cf952565cd73aebdba;hp=ec639aa3a1d379aa724938933195afd213a7789c;hpb=816724e65c72a90a44fbad0ef0b59b186c85fa90;p=linux-2.6 diff --git a/include/linux/swapops.h b/include/linux/swapops.h index ec639aa3a1..6ec39ab27b 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. @@ -108,7 +116,10 @@ extern void migration_entry_wait(struct mm_struct *mm, pmd_t *pmd, #else #define make_migration_entry(page, write) swp_entry(0, 0) -#define is_migration_entry(swp) 0 +static inline int is_migration_entry(swp_entry_t swp) +{ + return 0; +} #define migration_entry_to_page(swp) NULL static inline void make_migration_entry_read(swp_entry_t *entryp) { } static inline void migration_entry_wait(struct mm_struct *mm, pmd_t *pmd,