Skip to content

Commit bf813cd

Browse files
Dave ChinnerBen Myers
authored andcommitted
xfs: use kmem_zone_zalloc for buffers
To replace the alloc/memset pair. Signed-off-by: Dave Chinner <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Mark Tinguely <[email protected]> Signed-off-by: Ben Myers <[email protected]>
1 parent ead360c commit bf813cd

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

fs/xfs/xfs_buf.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ xfs_buf_alloc(
178178
{
179179
struct xfs_buf *bp;
180180

181-
bp = kmem_zone_alloc(xfs_buf_zone, xb_to_km(flags));
181+
bp = kmem_zone_zalloc(xfs_buf_zone, xb_to_km(flags));
182182
if (unlikely(!bp))
183183
return NULL;
184184

@@ -187,7 +187,6 @@ xfs_buf_alloc(
187187
*/
188188
flags &= ~(XBF_LOCK|XBF_MAPPED|XBF_DONT_BLOCK|XBF_READ_AHEAD);
189189

190-
memset(bp, 0, sizeof(xfs_buf_t));
191190
atomic_set(&bp->b_hold, 1);
192191
atomic_set(&bp->b_lru_ref, 1);
193192
init_completion(&bp->b_iowait);

0 commit comments

Comments
 (0)