diff mbox series

[36/45] lnet: use kmem_cache_zalloc as appropriate.

Message ID 1590444502-20533-37-git-send-email-jsimmons@infradead.org (mailing list archive)
State New, archived
Headers show
Series lustre: merged OpenSFS client patches from April 30 to today | expand

Commit Message

James Simmons May 25, 2020, 10:08 p.m. UTC
From: Mr NeilBrown <neilb@suse.de>

Rather than passing __GFP_ZERO to kmem_cache_alloc(), or calling
memset(0) after the allocation, use kmem_cache_zalloc().

kmem_cache_zalloc() has been part of Linux since 2.6.17.

WC-bug-id: https://jira.whamcloud.com/browse/LU-6142
Lustre-commit: 3ceed00b0458d ("LU-6142 kernel: use kmem_cache_zalloc as appropriate.")
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Reviewed-on: https://review.whamcloud.com/38439
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 net/lnet/lnet/lib-me.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/net/lnet/lnet/lib-me.c b/net/lnet/lnet/lib-me.c
index 8a47405..14ab21f 100644
--- a/net/lnet/lnet/lib-me.c
+++ b/net/lnet/lnet/lib-me.c
@@ -87,7 +87,7 @@  struct lnet_me *
 	if (!mtable) /* can't match portal type */
 		return ERR_PTR(-EPERM);
 
-	me = kmem_cache_alloc(lnet_mes_cachep, GFP_NOFS | __GFP_ZERO);
+	me = kmem_cache_zalloc(lnet_mes_cachep, GFP_NOFS);
 	if (!me)
 		return ERR_PTR(-ENOMEM);