Skip to content

Commit 31a9403

Browse files
qianfengrongMikulas Patocka
authored andcommitted
dm bufio: remove redundant __GFP_NOWARN
GFP_NOWAIT already includes __GFP_NOWARN, so let's remove the redundant __GFP_NOWARN. Also update comments to clarify the flag semantics. Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
1 parent d4f00a5 commit 31a9403

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

drivers/md/dm-bufio.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,7 +1337,7 @@ static void use_bio(struct dm_buffer *b, enum req_op op, sector_t sector,
13371337
char *ptr;
13381338
unsigned int len;
13391339

1340-
bio = bio_kmalloc(1, GFP_NOWAIT | __GFP_NORETRY | __GFP_NOWARN);
1340+
bio = bio_kmalloc(1, GFP_NOWAIT);
13411341
if (!bio) {
13421342
use_dmio(b, op, sector, n_sectors, offset, ioprio);
13431343
return;
@@ -1601,18 +1601,18 @@ static struct dm_buffer *__alloc_buffer_wait_no_callback(struct dm_bufio_client
16011601
* dm-bufio is resistant to allocation failures (it just keeps
16021602
* one buffer reserved in cases all the allocations fail).
16031603
* So set flags to not try too hard:
1604-
* GFP_NOWAIT: don't wait; if we need to sleep we'll release our
1605-
* mutex and wait ourselves.
1604+
* GFP_NOWAIT: don't wait and don't print a warning in case of
1605+
* failure; if we need to sleep we'll release our mutex
1606+
* and wait ourselves.
16061607
* __GFP_NORETRY: don't retry and rather return failure
16071608
* __GFP_NOMEMALLOC: don't use emergency reserves
1608-
* __GFP_NOWARN: don't print a warning in case of failure
16091609
*
16101610
* For debugging, if we set the cache size to 1, no new buffers will
16111611
* be allocated.
16121612
*/
16131613
while (1) {
16141614
if (dm_bufio_cache_size_latch != 1) {
1615-
b = alloc_buffer(c, GFP_NOWAIT | __GFP_NORETRY | __GFP_NOMEMALLOC | __GFP_NOWARN);
1615+
b = alloc_buffer(c, GFP_NOWAIT | __GFP_NORETRY | __GFP_NOMEMALLOC);
16161616
if (b)
16171617
return b;
16181618
}

0 commit comments

Comments
 (0)