Skip to content

Commit

Permalink
xfs: use kmem_zone_zalloc for buffers
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dave Chinner authored and Ben Myers committed May 14, 2012
1 parent ead360c commit bf813cd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fs/xfs/xfs_buf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);
Expand Down

0 comments on commit bf813cd

Please sign in to comment.