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()
172 static inline int is_swapin_error_entry(swp_entry_t entry) in is_swapin_error_entry() argument
174 return swp_type(entry) == SWP_SWAPIN_ERROR; in is_swapin_error_entry()
188 static inline bool is_device_private_entry(swp_entry_t entry) in is_device_private_entry() argument
190 int type = swp_type(entry); in is_device_private_entry()
194 static inline bool is_writable_device_private_entry(swp_entry_t entry) in is_writable_device_private_entry() argument
196 return unlikely(swp_type(entry) == SWP_DEVICE_WRITE); in is_writable_device_private_entry()
209 static inline bool is_device_exclusive_entry(swp_entry_t entry) in is_device_exclusive_entry() argument
211 return swp_type(entry) == SWP_DEVICE_EXCLUSIVE_READ || in is_device_exclusive_entry()
212 swp_type(entry) == SWP_DEVICE_EXCLUSIVE_WRITE; in is_device_exclusive_entry()
215 static inline bool is_writable_device_exclusive_entry(swp_entry_t entry) in is_writable_device_exclusive_entry() argument
217 return unlikely(swp_type(entry) == SWP_DEVICE_EXCLUSIVE_WRITE); in is_writable_device_exclusive_entry()
230 static inline bool is_device_private_entry(swp_entry_t entry) in is_device_private_entry() argument
235 static inline bool is_writable_device_private_entry(swp_entry_t entry) in is_writable_device_private_entry() argument
250 static inline bool is_device_exclusive_entry(swp_entry_t entry) in is_device_exclusive_entry() argument
255 static inline bool is_writable_device_exclusive_entry(swp_entry_t entry) in is_writable_device_exclusive_entry() argument
262 static inline int is_migration_entry(swp_entry_t entry) in is_migration_entry() argument
264 return unlikely(swp_type(entry) == SWP_MIGRATION_READ || in is_migration_entry()
265 swp_type(entry) == SWP_MIGRATION_READ_EXCLUSIVE || in is_migration_entry()
266 swp_type(entry) == SWP_MIGRATION_WRITE); in is_migration_entry()
269 static inline int is_writable_migration_entry(swp_entry_t entry) in is_writable_migration_entry() argument
271 return unlikely(swp_type(entry) == SWP_MIGRATION_WRITE); in is_writable_migration_entry()
274 static inline int is_readable_migration_entry(swp_entry_t entry) in is_readable_migration_entry() argument
276 return unlikely(swp_type(entry) == SWP_MIGRATION_READ); in is_readable_migration_entry()
279 static inline int is_readable_exclusive_migration_entry(swp_entry_t entry) in is_readable_exclusive_migration_entry() argument
281 return unlikely(swp_type(entry) == SWP_MIGRATION_READ_EXCLUSIVE); in is_readable_exclusive_migration_entry()
313 static inline swp_entry_t make_migration_entry_young(swp_entry_t entry) in make_migration_entry_young() argument
316 return swp_entry(swp_type(entry), in make_migration_entry_young()
317 swp_offset(entry) | SWP_MIG_YOUNG); in make_migration_entry_young()
318 return entry; in make_migration_entry_young()
321 static inline bool is_migration_entry_young(swp_entry_t entry) in is_migration_entry_young() argument
324 return swp_offset(entry) & SWP_MIG_YOUNG; in is_migration_entry_young()
329 static inline swp_entry_t make_migration_entry_dirty(swp_entry_t entry) in make_migration_entry_dirty() argument
332 return swp_entry(swp_type(entry), in make_migration_entry_dirty()
333 swp_offset(entry) | SWP_MIG_DIRTY); in make_migration_entry_dirty()
334 return entry; in make_migration_entry_dirty()
337 static inline bool is_migration_entry_dirty(swp_entry_t entry) in is_migration_entry_dirty() argument
340 return swp_offset(entry) & SWP_MIG_DIRTY; in is_migration_entry_dirty()
382 static inline int is_writable_migration_entry(swp_entry_t entry) in is_writable_migration_entry() argument
386 static inline int is_readable_migration_entry(swp_entry_t entry) in is_readable_migration_entry() argument
391 static inline swp_entry_t make_migration_entry_young(swp_entry_t entry) in make_migration_entry_young() argument
393 return entry; in make_migration_entry_young()
396 static inline bool is_migration_entry_young(swp_entry_t entry) in is_migration_entry_young() argument
401 static inline swp_entry_t make_migration_entry_dirty(swp_entry_t entry) in make_migration_entry_dirty() argument
403 return entry; in make_migration_entry_dirty()
406 static inline bool is_migration_entry_dirty(swp_entry_t entry) in is_migration_entry_dirty() argument
424 static inline bool is_pte_marker_entry(swp_entry_t entry) in is_pte_marker_entry() argument
426 return swp_type(entry) == SWP_PTE_MARKER; in is_pte_marker_entry()
429 static inline pte_marker pte_marker_get(swp_entry_t entry) in pte_marker_get() argument
431 return swp_offset(entry) & PTE_MARKER_MASK; in pte_marker_get()
448 static inline bool is_pte_marker_entry(swp_entry_t entry) in is_pte_marker_entry() argument
453 static inline pte_marker pte_marker_get(swp_entry_t entry) in pte_marker_get() argument
491 static inline struct page *pfn_swap_entry_to_page(swp_entry_t entry) in pfn_swap_entry_to_page() argument
493 struct page *p = pfn_to_page(swp_offset_pfn(entry)); in pfn_swap_entry_to_page()
499 BUG_ON(is_migration_entry(entry) && !PageLocked(p)); in pfn_swap_entry_to_page()
505 * A pfn swap entry is a special type of swap entry that always has a pfn stored
509 static inline bool is_pfn_swap_entry(swp_entry_t entry) in is_pfn_swap_entry() argument
514 return is_migration_entry(entry) || is_device_private_entry(entry) || in is_pfn_swap_entry()
515 is_device_exclusive_entry(entry); in is_pfn_swap_entry()
541 static inline pmd_t swp_entry_to_pmd(swp_entry_t entry) in swp_entry_to_pmd() argument
545 arch_entry = __swp_entry(swp_type(entry), swp_offset(entry)); in swp_entry_to_pmd()
573 static inline pmd_t swp_entry_to_pmd(swp_entry_t entry) in swp_entry_to_pmd() argument
597 static inline int is_hwpoison_entry(swp_entry_t entry) in is_hwpoison_entry() argument
599 return swp_type(entry) == SWP_HWPOISON; in is_hwpoison_entry()
633 static inline int non_swap_entry(swp_entry_t entry) in non_swap_entry() argument
635 return swp_type(entry) >= MAX_SWAPFILES; in non_swap_entry()