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 <ha...@hauke-m.de>
---
 backport/backport-include/linux/mm.h                             | 9 +++++++++
 .../network/0049-no-pfmemalloc/no-pfmemalloc.cocci               | 2 +-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/backport/backport-include/linux/mm.h 
b/backport/backport-include/linux/mm.h
index 96be9e6..ddb8813 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 bbc1201..5c6dd24 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) */
  ;
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe backports" in

Reply via email to