summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2016-11-15 08:28:38 -0900
committerKent Overstreet <kent.overstreet@gmail.com>2016-11-15 08:28:38 -0900
commitda3dd9e634e7ebb4ba0fb80dafd1f5c9db82dc05 (patch)
tree6bd49f2242ab40c34cf7bf6b8da5dc97cc4142a2
parent86421f3837a9f6c4d93bccc8dfe3d046def072db (diff)
bcache: use __GFP_NOWARN if we're going to fall back to vmalloc()
-rw-r--r--drivers/md/bcache/fifo.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/md/bcache/fifo.h b/drivers/md/bcache/fifo.h
index 32a17c92b698..2908ca239f39 100644
--- a/drivers/md/bcache/fifo.h
+++ b/drivers/md/bcache/fifo.h
@@ -7,9 +7,13 @@
type *data; \
} name
-#define init_fifo(fifo, _size, gfp) \
+#define init_fifo(fifo, _size, _gfp) \
({ \
bool _ret = true; \
+ gfp_t gfp_flags = (_gfp); \
+ \
+ if (gfp_flags & GFP_KERNEL) \
+ gfp_flags |= __GFP_NOWARN; \
\
(fifo)->size = (_size); \
(fifo)->front = (fifo)->back = 0; \
@@ -24,8 +28,8 @@
(fifo)->mask = _allocated_size - 1; \
\
if (_bytes < KMALLOC_MAX_SIZE) \
- (fifo)->data = kmalloc(_bytes, (gfp)); \
- if ((!(fifo)->data) && ((gfp) & GFP_KERNEL)) \
+ (fifo)->data = kmalloc(_bytes, gfp_flags); \
+ if ((!(fifo)->data) && (gfp_flags & GFP_KERNEL)) \
(fifo)->data = vmalloc(_bytes); \
if ((!(fifo)->data)) \
_ret = false; \