mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 3/3] bio-integrity: use kmem_cache_zalloc in bio_integrity_alloc_bioset()
@ 2012-02-03 13:50 amit.sahrawat83
  0 siblings, 0 replies; only message in thread
From: amit.sahrawat83 @ 2012-02-03 13:50 UTC (permalink / raw)
  To: Alexander Viro; +Cc: Amit Sahrawat, linux-fsdevel, linux-kernel, Amit Sahrawat

From: Amit Sahrawat <amit.sahrawat83@gmail.com>

Use advantage of kmem_cache_zalloc() to remove memset() call in
bio_integrity_alloc_bioset()

Signed-off-by: Amit Sahrawat <a.sahrawat@samsung.com>
---
 fs/bio-integrity.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/fs/bio-integrity.c b/fs/bio-integrity.c
index c2183f3..836e34b 100644
--- a/fs/bio-integrity.c
+++ b/fs/bio-integrity.c
@@ -93,7 +93,7 @@ struct bio_integrity_payload *bio_integrity_alloc_bioset(struct bio *bio,
 
 	/* Lower order allocations come straight from slab */
 	if (!use_bip_pool(idx))
-		bip = kmem_cache_alloc(bip_slab[idx].slab, gfp_mask);
+		bip = kmem_cache_zalloc(bip_slab[idx].slab, gfp_mask);
 
 	/* Use mempool if lower order alloc failed or max vecs were requested */
 	if (bip == NULL) {
@@ -106,8 +106,6 @@ struct bio_integrity_payload *bio_integrity_alloc_bioset(struct bio *bio,
 		}
 	}
 
-	memset(bip, 0, sizeof(*bip));
-
 	bip->bip_slab = idx;
 	bip->bip_bio = bio;
 	bio->bi_integrity = bip;
-- 
1.7.2.3


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-02-03 13:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-03 13:50 [PATCH 3/3] bio-integrity: use kmem_cache_zalloc in bio_integrity_alloc_bioset() amit.sahrawat83

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®