| To: | xfs@xxxxxxxxxxx |
|---|---|
| Subject: | [PATCH 3/8] xfs: use kmem_zone_zalloc for buffers |
| From: | Dave Chinner <david@xxxxxxxxxxxxx> |
| Date: | Thu, 29 Mar 2012 23:23:50 +1100 |
| In-reply-to: | <1333023835-12856-1-git-send-email-david@xxxxxxxxxxxxx> |
| References: | <1333023835-12856-1-git-send-email-david@xxxxxxxxxxxxx> |
From: Dave Chinner <dchinner@xxxxxxxxxx>
To replace the alloc/memset pair.
Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
---
fs/xfs/xfs_buf.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
index 9063461..d1ba21d 100644
--- a/fs/xfs/xfs_buf.c
+++ b/fs/xfs/xfs_buf.c
@@ -172,7 +172,7 @@ xfs_buf_alloc(
{
struct xfs_buf *bp;
- bp = kmem_zone_alloc(xfs_buf_zone, xb_to_km(flags));
+ bp = kmem_zone_zalloc(xfs_buf_zone, xb_to_km(flags));
if (unlikely(!bp))
return NULL;
@@ -181,7 +181,6 @@ xfs_buf_alloc(
*/
flags &= ~(XBF_LOCK|XBF_MAPPED|XBF_DONT_BLOCK|XBF_READ_AHEAD);
- memset(bp, 0, sizeof(xfs_buf_t));
atomic_set(&bp->b_hold, 1);
atomic_set(&bp->b_lru_ref, 1);
init_completion(&bp->b_iowait);
--
1.7.9
|
| Previous by Date: | [PATCH 2/8] xfs: fix incorrect b_offset initialisation, Dave Chinner |
|---|---|
| Next by Date: | [PATCH 5/8] xfs: kill b_file_offset, Dave Chinner |
| Previous by Thread: | Re: [PATCH 2/8] xfs: fix incorrect b_offset initialisation, Mark Tinguely |
| Next by Thread: | Re: [PATCH 3/8] xfs: use kmem_zone_zalloc for buffers, Christoph Hellwig |
| Indexes: | [Date] [Thread] [Top] [All Lists] |