mm/z3fold.c: use gfpflags_allow_blocking
authorMatthew Wilcox <[email protected]>
Tue, 10 Apr 2018 23:29:37 +0000 (16:29 -0700)
committerLinus Torvalds <[email protected]>
Wed, 11 Apr 2018 17:28:31 +0000 (10:28 -0700)
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/[email protected]
Signed-off-by: Matthew Wilcox <[email protected]>
Reviewed-by: Andrew Morton <[email protected]>
Cc: Vitaly Wool <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/z3fold.c

index c6b1fb0d85a57251bc50eeb7f7e652160dd69920..c0bca6153b95d2257333fabe9c1b3eb398d66488 100644 (file)
@@ -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;