summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2015-09-13 13:09:15 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2015-11-15 22:12:50 +0100
commit05817a0b96d5ef4ba561d0d9da8e325c7a7436e0 (patch)
tree8669b36713a8ff0456939457afa6d133ef98a0f8
parent907244a8812becdbb38d28f32a09b462a0560985 (diff)
header: add page_is_pfmemalloc()
Upstream commit: 2fdda07a83179d14f41a15bf88ae396dae9d218d This adds page_is_pfmemalloc() which is used by the igb driver. The direct access to page->pfmemalloc was replaced by this function call in 54d985ce23 upstream commit. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r--backport/backport-include/linux/mm.h9
-rw-r--r--patches/collateral-evolutions/network/0049-no-pfmemalloc/no-pfmemalloc.cocci2
2 files changed, 10 insertions, 1 deletions
diff --git a/backport/backport-include/linux/mm.h b/backport/backport-include/linux/mm.h
index 96be9e6f..ddb88134 100644
--- a/backport/backport-include/linux/mm.h
+++ b/backport/backport-include/linux/mm.h
@@ -95,4 +95,13 @@ static inline unsigned long *frame_vector_pfns(struct frame_vector *vec)
}
#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0) && \
+ LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)
+#define page_is_pfmemalloc LINUX_BACKPORT(page_is_pfmemalloc)
+static inline bool page_is_pfmemalloc(struct page *page)
+{
+ return page->pfmemalloc;
+}
+#endif /* < 4.2 */
+
#endif /* __BACKPORT_MM_H */
diff --git a/patches/collateral-evolutions/network/0049-no-pfmemalloc/no-pfmemalloc.cocci b/patches/collateral-evolutions/network/0049-no-pfmemalloc/no-pfmemalloc.cocci
index bbc12012..5c6dd242 100644
--- a/patches/collateral-evolutions/network/0049-no-pfmemalloc/no-pfmemalloc.cocci
+++ b/patches/collateral-evolutions/network/0049-no-pfmemalloc/no-pfmemalloc.cocci
@@ -4,6 +4,6 @@ expression E1;
@@
return E1
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)
- || page->pfmemalloc
+ || page_is_pfmemalloc(page)
+#endif /* if LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0) */
;