diff options
| author | Ankit Agrawal <ankita@nvidia.com> | 2026-01-15 20:28:48 +0000 |
|---|---|---|
| committer | Alex Williamson <alex@shazbot.org> | 2026-01-19 10:06:31 -0700 |
| commit | 205e6d17cdf5b7f7b221bf64be9850eabce429c9 (patch) | |
| tree | e1b068ebedb8f2ae0b06d4c237df6145ec444e90 /include | |
| parent | 1c588bca3bd5b39c93a28a5986bf82ebfb05eec2 (diff) | |
mm: add stubs for PFNMAP memory failure registration functions
Add stubs to address CONFIG_MEMORY_FAILURE disabled.
Suggested-by: Alex Williamson <alex@shazbot.org>
Signed-off-by: Ankit Agrawal <ankita@nvidia.com>
Link: https://lore.kernel.org/r/20260115202849.2921-2-ankita@nvidia.com
Signed-off-by: Alex Williamson <alex@shazbot.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/memory-failure.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/include/linux/memory-failure.h b/include/linux/memory-failure.h index 7b5e11cf905f..d333dcdbeae7 100644 --- a/include/linux/memory-failure.h +++ b/include/linux/memory-failure.h @@ -4,8 +4,6 @@ #include <linux/interval_tree.h> -struct pfn_address_space; - struct pfn_address_space { struct interval_tree_node node; struct address_space *mapping; @@ -13,7 +11,18 @@ struct pfn_address_space { unsigned long pfn, pgoff_t *pgoff); }; +#ifdef CONFIG_MEMORY_FAILURE int register_pfn_address_space(struct pfn_address_space *pfn_space); void unregister_pfn_address_space(struct pfn_address_space *pfn_space); +#else +static inline int register_pfn_address_space(struct pfn_address_space *pfn_space) +{ + return -EOPNOTSUPP; +} + +static inline void unregister_pfn_address_space(struct pfn_address_space *pfn_space) +{ +} +#endif /* CONFIG_MEMORY_FAILURE */ #endif /* _LINUX_MEMORY_FAILURE_H */ |
