Skip to content

Commit

Permalink
mm/z3fold.c: use gfpflags_allow_blocking
Browse files Browse the repository at this point in the history
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.

Link: http://lkml.kernel.org/r/20180408062206.GC16007@bombadil.infradead.org
Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Vitaly Wool <vitalywool@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Matthew Wilcox authored and Linus Torvalds committed Apr 11, 2018
1 parent 1ec6995 commit 8a97ea5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/z3fold.c
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,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;
Expand Down

0 comments on commit 8a97ea5

Please sign in to comment.