diff options
author | OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> | 2006-02-03 06:04:43 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-02-03 11:32:10 -0500 |
commit | e60e5c50aa5389db86e96fc52d02bc7db3d23f4a (patch) | |
tree | dcf9d09c7fed328628750023fecaf3eef4ad8624 | |
parent | 5b00226d4d3aa7969d84e16f857ea100465d9c98 (diff) |
[PATCH] Trivial optimization of ll_rw_block()
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 <hirofumi@mail.parknet.co.jp>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | fs/buffer.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/buffer.c b/fs/buffer.c index 5e4a90ee103f..62cfd17dc5fe 100644 --- a/fs/buffer.c +++ b/fs/buffer.c | |||
@@ -2867,22 +2867,22 @@ void ll_rw_block(int rw, int nr, struct buffer_head *bhs[]) | |||
2867 | else if (test_set_buffer_locked(bh)) | 2867 | else if (test_set_buffer_locked(bh)) |
2868 | continue; | 2868 | continue; |
2869 | 2869 | ||
2870 | get_bh(bh); | ||
2871 | if (rw == WRITE || rw == SWRITE) { | 2870 | if (rw == WRITE || rw == SWRITE) { |
2872 | if (test_clear_buffer_dirty(bh)) { | 2871 | if (test_clear_buffer_dirty(bh)) { |
2873 | bh->b_end_io = end_buffer_write_sync; | 2872 | bh->b_end_io = end_buffer_write_sync; |
2873 | get_bh(bh); | ||
2874 | submit_bh(WRITE, bh); | 2874 | submit_bh(WRITE, bh); |
2875 | continue; | 2875 | continue; |
2876 | } | 2876 | } |
2877 | } else { | 2877 | } else { |
2878 | if (!buffer_uptodate(bh)) { | 2878 | if (!buffer_uptodate(bh)) { |
2879 | bh->b_end_io = end_buffer_read_sync; | 2879 | bh->b_end_io = end_buffer_read_sync; |
2880 | get_bh(bh); | ||
2880 | submit_bh(rw, bh); | 2881 | submit_bh(rw, bh); |
2881 | continue; | 2882 | continue; |
2882 | } | 2883 | } |
2883 | } | 2884 | } |
2884 | unlock_buffer(bh); | 2885 | unlock_buffer(bh); |
2885 | put_bh(bh); | ||
2886 | } | 2886 | } |
2887 | } | 2887 | } |
2888 | 2888 | ||