Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _LINUX_MEMORY_FAILURE_H
3#define _LINUX_MEMORY_FAILURE_H
4
5#include <linux/interval_tree.h>
6
7struct pfn_address_space {
8 struct interval_tree_node node;
9 struct address_space *mapping;
10 int (*pfn_to_vma_pgoff)(struct vm_area_struct *vma,
11 unsigned long pfn, pgoff_t *pgoff);
12};
13
14#ifdef CONFIG_MEMORY_FAILURE
15int register_pfn_address_space(struct pfn_address_space *pfn_space);
16void unregister_pfn_address_space(struct pfn_address_space *pfn_space);
17#else
18static inline int register_pfn_address_space(struct pfn_address_space *pfn_space)
19{
20 return -EOPNOTSUPP;
21}
22
23static inline void unregister_pfn_address_space(struct pfn_address_space *pfn_space)
24{
25}
26#endif /* CONFIG_MEMORY_FAILURE */
27
28#endif /* _LINUX_MEMORY_FAILURE_H */