From 8b3cb154856623a03b3cb0dc3e3fbce9a693e831 Mon Sep 17 00:00:00 2001 From: Yang Sheng Date: Fri, 1 Dec 2017 22:44:46 +0800 Subject: [PATCH] LU-10565 mdc: add __GFP_COLD for back compatible The __GFP_COLD has been removed in upstream. Add it for compatible. Signed-off-by: Yang Sheng Change-Id: I70d0978fa1cdfb9ea22f0b1511a26b28523048b6 Reviewed-on: https://review.whamcloud.com/31028 Tested-by: Jenkins Reviewed-by: Bob Glossman Tested-by: Maloo Reviewed-by: Emoly Liu Reviewed-by: Oleg Drokin --- lustre/include/lustre_compat.h | 5 +++++ lustre/mdc/mdc_request.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lustre/include/lustre_compat.h b/lustre/include/lustre_compat.h index 2e41ef4..4a3a0cf 100644 --- a/lustre/include/lustre_compat.h +++ b/lustre/include/lustre_compat.h @@ -678,6 +678,11 @@ static inline struct timespec current_time(struct inode *inode) */ #define time_after32(a, b) ((s32)((u32)(b) - (u32)(a)) < 0) #define time_before32(b, a) time_after32(a, b) + +#endif + +#ifndef __GFP_COLD +#define __GFP_COLD 0 #endif #endif /* _LUSTRE_COMPAT_H */ diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c index 6dd1a06..7bdbc11 100644 --- a/lustre/mdc/mdc_request.c +++ b/lustre/mdc/mdc_request.c @@ -1263,7 +1263,8 @@ static int mdc_read_page_remote(void *data, struct page *page0) } for (npages = 1; npages < max_pages; npages++) { - page = page_cache_alloc_cold(inode->i_mapping); + page = __page_cache_alloc(mapping_gfp_mask(inode->i_mapping) + | __GFP_COLD); if (page == NULL) break; page_pool[npages] = page; -- 1.8.3.1