[PATCH 2/2] fs/buffer.c: remove redundant initialization in alloc_page_buffers()

Yan Hong
2012-11-22T22:24:10Z

buffer_head comes from kmem_cache_zalloc(), no need to zero
its field.

Signed-off-by: Yan Hong <clouds.yan@gmail.com>
---

init_buffer() can be actually removed too, but I'm afraid someday its
semantic will beyond initializing ->b_end_io and ->b_private.

fs/buffer.c | 3 ---
1 file changed, 3 deletions(-)

diff --git a/fs/buffer.c b/fs/buffer.c
index 69e83ee..ad87aa6 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -849,13 +849,10 @@ try_again:
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 */
--
1.7.9.5