bio-integrity: use kmem_cache_zalloc in bio_integrity_alloc_bioset()
PATCH 3/3 bio-integrity: use kmem_cache_zalloc in bio_integrity_alloc_bioset()
From: Amit Sahrawat <[email protected]>
Use advantage of kmem_cache_zalloc() to remove memset() call in bio_integrity_alloc_bioset()
Signed-off-by Amit Sahrawat <[email protected]>
--- fs/bio-integrity.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)
fs/bio-integrity.c +1 -3
@@ -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;
Signature · 1 line
1.7.2.3