xfs
[Top] [All Lists]

[PATCH 084/102] xfs: use kmem_zone_zalloc for buffers

To: xfs@xxxxxxxxxxx
Subject: [PATCH 084/102] xfs: use kmem_zone_zalloc for buffers
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Thu, 23 Aug 2012 15:02:42 +1000
In-reply-to: <1345698180-13612-1-git-send-email-david@xxxxxxxxxxxxx>
References: <1345698180-13612-1-git-send-email-david@xxxxxxxxxxxxx>
From: Dave Chinner <dchinner@xxxxxxxxxx>

Upstream commit: bf813cdddfb3a5bc88e1612e8f62a12367871213

To replace the alloc/memset pair.

Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
Reviewed-by: Christoph Hellwig <hch@xxxxxx>
Reviewed-by: Mark Tinguely <tinguely@xxxxxxx>
Signed-off-by: Ben Myers <bpm@xxxxxxx>
---
 fs/xfs/linux-2.6/xfs_buf.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c
index 3e9946c..522ab83 100644
--- a/fs/xfs/linux-2.6/xfs_buf.c
+++ b/fs/xfs/linux-2.6/xfs_buf.c
@@ -170,7 +170,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;
 
@@ -179,7 +179,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.10

<Prev in Thread] Current Thread [Next in Thread>