From: Matthew Wilcox <willy@infradead.org>
To: Vitaly Wool <vitalywool@gmail.com>
Cc: linux-mm@kvack.org
Subject: [PATCH] z3fold: Use gfpflags_allow_blocking
Date: Sat, 7 Apr 2018 23:22:06 -0700 [thread overview]
Message-ID: <20180408062206.GC16007@bombadil.infradead.org> (raw)
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;
reply other threads:[~2018-04-08 6:22 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180408062206.GC16007@bombadil.infradead.org \
--to=willy@infradead.org \
--cc=linux-mm@kvack.org \
--cc=vitalywool@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).