[PATCH 6/7] dm-stats: use kvmalloc_node
From: Mikulas Patocka
Date: Tue Jul 07 2015 - 11:12:52 EST
Use kvmalloc_node just to clean up the code and remove duplicated logic.
Signed-off-by: Mikulas Patocka <mpatocka@xxxxxxxxxx>
---
drivers/md/dm-stats.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
Index: linux-4.1/drivers/md/dm-stats.c
===================================================================
--- linux-4.1.orig/drivers/md/dm-stats.c 2015-07-02 19:21:39.000000000 +0200
+++ linux-4.1/drivers/md/dm-stats.c 2015-07-02 19:23:00.000000000 +0200
@@ -146,12 +146,7 @@ static void *dm_stats_kvzalloc(size_t al
if (!claim_shared_memory(alloc_size))
return NULL;
- if (alloc_size <= KMALLOC_MAX_SIZE) {
- p = kzalloc_node(alloc_size, GFP_KERNEL | __GFP_NORETRY | __GFP_NOMEMALLOC | __GFP_NOWARN, node);
- if (p)
- return p;
- }
- p = vzalloc_node(alloc_size, node);
+ p = kvmalloc_node(alloc_size, GFP_KERNEL | __GFP_ZERO, node);
if (p)
return p;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/