summaryrefslogtreecommitdiff
path: root/include/linux/userfaultfd_k.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/userfaultfd_k.h')
-rw-r--r--include/linux/userfaultfd_k.h51
1 files changed, 2 insertions, 49 deletions
diff --git a/include/linux/userfaultfd_k.h b/include/linux/userfaultfd_k.h
index da0b4fcc566f..983c860a00f1 100644
--- a/include/linux/userfaultfd_k.h
+++ b/include/linux/userfaultfd_k.h
@@ -16,7 +16,7 @@
#include <linux/fcntl.h>
#include <linux/mm.h>
#include <linux/swap.h>
-#include <linux/swapops.h>
+#include <linux/leafops.h>
#include <asm-generic/pgtable_uffd.h>
#include <linux/hugetlb_inline.h>
@@ -434,32 +434,6 @@ static inline bool userfaultfd_wp_use_markers(struct vm_area_struct *vma)
return userfaultfd_wp_unpopulated(vma);
}
-static inline bool pte_marker_entry_uffd_wp(swp_entry_t entry)
-{
-#ifdef CONFIG_PTE_MARKER_UFFD_WP
- return is_pte_marker_entry(entry) &&
- (pte_marker_get(entry) & PTE_MARKER_UFFD_WP);
-#else
- return false;
-#endif
-}
-
-static inline bool pte_marker_uffd_wp(pte_t pte)
-{
-#ifdef CONFIG_PTE_MARKER_UFFD_WP
- swp_entry_t entry;
-
- if (!is_swap_pte(pte))
- return false;
-
- entry = pte_to_swp_entry(pte);
-
- return pte_marker_entry_uffd_wp(entry);
-#else
- return false;
-#endif
-}
-
/*
* Returns true if this is a swap pte and was uffd-wp wr-protected in either
* forms (pte marker or a normal swap pte), false otherwise.
@@ -473,31 +447,10 @@ static inline bool pte_swp_uffd_wp_any(pte_t pte)
if (pte_swp_uffd_wp(pte))
return true;
- if (pte_marker_uffd_wp(pte))
+ if (pte_is_uffd_wp_marker(pte))
return true;
#endif
return false;
}
-
-static inline bool is_uffd_pte_marker(pte_t pte)
-{
- swp_entry_t entry;
-
- if (pte_present(pte))
- return false;
-
- entry = pte_to_swp_entry(pte);
- if (!is_pte_marker_entry(entry))
- return false;
-
- /* UFFD WP, poisoned swap entries are UFFD handled. */
- if (pte_marker_entry_uffd_wp(entry))
- return true;
- if (is_poisoned_swp_entry(entry))
- return true;
-
- return false;
-}
-
#endif /* _LINUX_USERFAULTFD_K_H */