linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] z3fold: Use gfpflags_allow_blocking
@ 2018-04-08  6:22 Matthew Wilcox
  0 siblings, 0 replies; only message in thread
From: Matthew Wilcox @ 2018-04-08  6:22 UTC (permalink / raw)
  To: Vitaly Wool; +Cc: linux-mm

From: Matthew Wilcox <mawilcox@microsoft.com>

We have a perfectly good macro to determine whether the gfp flags allow
you to sleep or not; use it instead of trying to infer it.

Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>

diff --git a/mm/z3fold.c b/mm/z3fold.c
index d589d318727f..46fed640a956 100644
--- a/mm/z3fold.c
+++ b/mm/z3fold.c
@@ -533,7 +533,7 @@ static int z3fold_alloc(struct z3fold_pool *pool, size_t size, gfp_t gfp,
 	struct z3fold_header *zhdr = NULL;
 	struct page *page = NULL;
 	enum buddy bud;
-	bool can_sleep = (gfp & __GFP_RECLAIM) == __GFP_RECLAIM;
+	bool can_sleep = gfpflags_allow_blocking(gfp);
 
 	if (!size || (gfp & __GFP_HIGHMEM))
 		return -EINVAL;

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-04-08  6:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-08  6:22 [PATCH] z3fold: Use gfpflags_allow_blocking Matthew Wilcox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).