]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/nvdimm/pmem.h
drm/i915/execlists: Refactor -EIO markup of hung requests
[linux.git] / drivers / nvdimm / pmem.h
index a64ebc78b5dffbac4072fc722d9961650e681f88..59cfe13ea8a85c3bcccf9211409ae237196626d5 100644 (file)
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 #ifndef __NVDIMM_PMEM_H__
 #define __NVDIMM_PMEM_H__
+#include <linux/page-flags.h>
 #include <linux/badblocks.h>
 #include <linux/types.h>
 #include <linux/pfn_t.h>
@@ -27,4 +28,16 @@ struct pmem_device {
 
 long __pmem_direct_access(struct pmem_device *pmem, pgoff_t pgoff,
                long nr_pages, void **kaddr, pfn_t *pfn);
+
+#ifdef CONFIG_MEMORY_FAILURE
+static inline bool test_and_clear_pmem_poison(struct page *page)
+{
+       return TestClearPageHWPoison(page);
+}
+#else
+static inline bool test_and_clear_pmem_poison(struct page *page)
+{
+       return false;
+}
+#endif
 #endif /* __NVDIMM_PMEM_H__ */