From: OGAWA Hirofumi The ll_rw_block() needs to get ref-count only if it submits a buffer(). This patch avoids the needless get/put of ref-count. Signed-off-by: OGAWA Hirofumi Signed-off-by: Andrew Morton --- fs/buffer.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff -puN fs/buffer.c~trivial-optimization-of-ll_rw_block fs/buffer.c --- 25/fs/buffer.c~trivial-optimization-of-ll_rw_block Tue Jan 31 14:03:37 2006 +++ 25-akpm/fs/buffer.c Tue Jan 31 14:03:37 2006 @@ -2866,22 +2866,22 @@ void ll_rw_block(int rw, int nr, struct else if (test_set_buffer_locked(bh)) continue; - get_bh(bh); if (rw == WRITE || rw == SWRITE) { if (test_clear_buffer_dirty(bh)) { bh->b_end_io = end_buffer_write_sync; + get_bh(bh); submit_bh(WRITE, bh); continue; } } else { if (!buffer_uptodate(bh)) { bh->b_end_io = end_buffer_read_sync; + get_bh(bh); submit_bh(rw, bh); continue; } } unlock_buffer(bh); - put_bh(bh); } } _