Lines Matching full:entry

45  * Migration swap entry specific bitfield definitions.  Layout:
69 static inline bool is_pfn_swap_entry(swp_entry_t entry);
98 static inline unsigned swp_type(swp_entry_t entry) in swp_type() argument
100 return (entry.val >> SWP_TYPE_SHIFT); in swp_type()
107 static inline pgoff_t swp_offset(swp_entry_t entry) in swp_offset() argument
109 return entry.val & SWP_OFFSET_MASK; in swp_offset()
113 * This should only be called upon a pfn swap entry to get the PFN stored
114 * in the swap entry. Please refers to is_pfn_swap_entry() for definition
115 * of pfn swap entry.
117 static inline unsigned long swp_offset_pfn(swp_entry_t entry) in swp_offset_pfn() argument
119 VM_BUG_ON(!is_pfn_swap_entry(entry)); in swp_offset_pfn()
120 return swp_offset(entry) & SWP_PFN_MASK; in swp_offset_pfn()
123 /* check whether a pte points to a swap entry */
146 static inline pte_t swp_entry_to_pte(swp_entry_t entry) in swp_entry_to_pte() argument
150 arch_entry = __swp_entry(swp_type(entry), swp_offset(entry)); in swp_entry_to_pte()
156 swp_entry_t entry; in radix_to_swp_entry() local
158 entry.val = xa_to_value(arg); in radix_to_swp_entry()
159 return entry; in radix_to_swp_entry()
162 static inline void *swp_to_radix_entry(swp_entry_t entry) in swp_to_radix_entry() argument
164 return xa_mk_value(entry.val); in swp_to_radix_entry()
178 static inline bool is_device_private_entry(swp_entry_t entry) in is_device_private_entry() argument
180 int type = swp_type(entry); in is_device_private_entry()
184 static inline bool is_writable_device_private_entry(swp_entry_t entry) in is_writable_device_private_entry() argument
186 return unlikely(swp_type(entry) == SWP_DEVICE_WRITE); in is_writable_device_private_entry()
199 static inline bool is_device_exclusive_entry(swp_entry_t entry) in is_device_exclusive_entry() argument
201 return swp_type(entry) == SWP_DEVICE_EXCLUSIVE_READ || in is_device_exclusive_entry()
202 swp_type(entry) == SWP_DEVICE_EXCLUSIVE_WRITE; in is_device_exclusive_entry()
205 static inline bool is_writable_device_exclusive_entry(swp_entry_t entry) in is_writable_device_exclusive_entry() argument
207 return unlikely(swp_type(entry) == SWP_DEVICE_EXCLUSIVE_WRITE); in is_writable_device_exclusive_entry()
220 static inline bool is_device_private_entry(swp_entry_t entry) in is_device_private_entry() argument
225 static inline bool is_writable_device_private_entry(swp_entry_t entry) in is_writable_device_private_entry() argument
240 static inline bool is_device_exclusive_entry(swp_entry_t entry) in is_device_exclusive_entry() argument
245 static inline bool is_writable_device_exclusive_entry(swp_entry_t entry) in is_writable_device_exclusive_entry() argument
252 static inline int is_migration_entry(swp_entry_t entry) in is_migration_entry() argument
254 return unlikely(swp_type(entry) == SWP_MIGRATION_READ || in is_migration_entry()
255 swp_type(entry) == SWP_MIGRATION_READ_EXCLUSIVE || in is_migration_entry()
256 swp_type(entry) == SWP_MIGRATION_WRITE); in is_migration_entry()
259 static inline int is_writable_migration_entry(swp_entry_t entry) in is_writable_migration_entry() argument
261 return unlikely(swp_type(entry) == SWP_MIGRATION_WRITE); in is_writable_migration_entry()
264 static inline int is_readable_migration_entry(swp_entry_t entry) in is_readable_migration_entry() argument
266 return unlikely(swp_type(entry) == SWP_MIGRATION_READ); in is_readable_migration_entry()
269 static inline int is_readable_exclusive_migration_entry(swp_entry_t entry) in is_readable_exclusive_migration_entry() argument
271 return unlikely(swp_type(entry) == SWP_MIGRATION_READ_EXCLUSIVE); in is_readable_exclusive_migration_entry()
303 static inline swp_entry_t make_migration_entry_young(swp_entry_t entry) in make_migration_entry_young() argument
306 return swp_entry(swp_type(entry), in make_migration_entry_young()
307 swp_offset(entry) | SWP_MIG_YOUNG); in make_migration_entry_young()
308 return entry; in make_migration_entry_young()
311 static inline bool is_migration_entry_young(swp_entry_t entry) in is_migration_entry_young() argument
314 return swp_offset(entry) & SWP_MIG_YOUNG; in is_migration_entry_young()
319 static inline swp_entry_t make_migration_entry_dirty(swp_entry_t entry) in make_migration_entry_dirty() argument
322 return swp_entry(swp_type(entry), in make_migration_entry_dirty()
323 swp_offset(entry) | SWP_MIG_DIRTY); in make_migration_entry_dirty()
324 return entry; in make_migration_entry_dirty()
327 static inline bool is_migration_entry_dirty(swp_entry_t entry) in is_migration_entry_dirty() argument
330 return swp_offset(entry) & SWP_MIG_DIRTY; in is_migration_entry_dirty()
363 static inline int is_writable_migration_entry(swp_entry_t entry) in is_writable_migration_entry() argument
367 static inline int is_readable_migration_entry(swp_entry_t entry) in is_readable_migration_entry() argument
372 static inline swp_entry_t make_migration_entry_young(swp_entry_t entry) in make_migration_entry_young() argument
374 return entry; in make_migration_entry_young()
377 static inline bool is_migration_entry_young(swp_entry_t entry) in is_migration_entry_young() argument
382 static inline swp_entry_t make_migration_entry_dirty(swp_entry_t entry) in make_migration_entry_dirty() argument
384 return entry; in make_migration_entry_dirty()
387 static inline bool is_migration_entry_dirty(swp_entry_t entry) in is_migration_entry_dirty() argument
404 static inline int is_hwpoison_entry(swp_entry_t entry) in is_hwpoison_entry() argument
406 return swp_type(entry) == SWP_HWPOISON; in is_hwpoison_entry()
448 static inline bool is_pte_marker_entry(swp_entry_t entry) in is_pte_marker_entry() argument
450 return swp_type(entry) == SWP_PTE_MARKER; in is_pte_marker_entry()
453 static inline pte_marker pte_marker_get(swp_entry_t entry) in pte_marker_get() argument
455 return swp_offset(entry) & PTE_MARKER_MASK; in pte_marker_get()
473 static inline int is_poisoned_swp_entry(swp_entry_t entry) in is_poisoned_swp_entry() argument
475 return is_pte_marker_entry(entry) && in is_poisoned_swp_entry()
476 (pte_marker_get(entry) & PTE_MARKER_POISONED); in is_poisoned_swp_entry()
485 static inline int is_guard_swp_entry(swp_entry_t entry) in is_guard_swp_entry() argument
487 return is_pte_marker_entry(entry) && in is_guard_swp_entry()
488 (pte_marker_get(entry) & PTE_MARKER_GUARD); in is_guard_swp_entry()
509 static inline struct page *pfn_swap_entry_to_page(swp_entry_t entry) in pfn_swap_entry_to_page() argument
511 struct page *p = pfn_to_page(swp_offset_pfn(entry)); in pfn_swap_entry_to_page()
517 BUG_ON(is_migration_entry(entry) && !PageLocked(p)); in pfn_swap_entry_to_page()
522 static inline struct folio *pfn_swap_entry_folio(swp_entry_t entry) in pfn_swap_entry_folio() argument
524 struct folio *folio = pfn_folio(swp_offset_pfn(entry)); in pfn_swap_entry_folio()
530 BUG_ON(is_migration_entry(entry) && !folio_test_locked(folio)); in pfn_swap_entry_folio()
536 * A pfn swap entry is a special type of swap entry that always has a pfn stored
541 static inline bool is_pfn_swap_entry(swp_entry_t entry) in is_pfn_swap_entry() argument
546 return is_migration_entry(entry) || is_device_private_entry(entry) || in is_pfn_swap_entry()
547 is_device_exclusive_entry(entry) || is_hwpoison_entry(entry); in is_pfn_swap_entry()
573 static inline pmd_t swp_entry_to_pmd(swp_entry_t entry) in swp_entry_to_pmd() argument
577 arch_entry = __swp_entry(swp_type(entry), swp_offset(entry)); in swp_entry_to_pmd()
605 static inline pmd_t swp_entry_to_pmd(swp_entry_t entry) in swp_entry_to_pmd() argument
616 static inline int non_swap_entry(swp_entry_t entry) in non_swap_entry() argument
618 return swp_type(entry) >= MAX_SWAPFILES; in non_swap_entry()