xfs: use kmem_zone_zalloc for buffers
authorDave Chinner <dchinner@redhat.com>
Mon, 23 Apr 2012 05:58:48 +0000 (15:58 +1000)
committerBen Myers <bpm@sgi.com>
Mon, 14 May 2012 21:20:44 +0000 (16:20 -0500)
To replace the alloc/memset pair.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
fs/xfs/xfs_buf.c

index ddfc58f405064655417d5e72d87ca627be9d38c0..f463dce42515e61f40b9a99b8ef1cf4185e8819f 100644 (file)
@@ -178,7 +178,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;
 
@@ -187,7 +187,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);