Skip to content

Commit

Permalink
fs/buffer.c: remove redundant initialization in alloc_page_buffers()
Browse files Browse the repository at this point in the history
buffer_head comes from kmem_cache_zalloc(), no need to zero its fields.

Signed-off-by: Yan Hong <clouds.yan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Yan Hong authored and Linus Torvalds committed Dec 13, 2012
1 parent a3f3c29 commit 02c0ab6
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions fs/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -849,13 +849,10 @@ struct buffer_head *alloc_page_buffers(struct page *page, unsigned long size,
if (!bh)
goto no_grow;

bh->b_bdev = NULL;
bh->b_this_page = head;
bh->b_blocknr = -1;
head = bh;

bh->b_state = 0;
atomic_set(&bh->b_count, 0);
bh->b_size = size;

/* Link the buffer to its page */
Expand Down

0 comments on commit 02c0ab6

Please sign in to comment.