From: amit.sahrawat83@gmail.com
To: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Amit Sahrawat <a.sahrawat@samsung.com>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
Amit Sahrawat <amit.sahrawat83@gmail.com>
Subject: [PATCH 3/3] bio-integrity: use kmem_cache_zalloc in bio_integrity_alloc_bioset()
Date: Fri, 3 Feb 2012 19:20:19 +0530 [thread overview]
Message-ID: <4f2be526.8706440a.5b8d.2713@mx.google.com> (raw)
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
reply other threads:[~2012-02-03 13:46 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4f2be526.8706440a.5b8d.2713@mx.google.com \
--to=amit.sahrawat83@gmail.com \
--cc=a.sahrawat@samsung.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®