aboutsummaryrefslogtreecommitdiffstats
path: root/fs/buffer.c
diff options
context:
space:
mode:
authorOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>2006-02-03 03:04:43 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-02-03 08:32:10 -0800
commite60e5c50aa5389db86e96fc52d02bc7db3d23f4a (patch)
treedcf9d09c7fed328628750023fecaf3eef4ad8624 /fs/buffer.c
parent[PATCH] fat: Replace an own implementation with ll_rw_block(SWRITE,) (diff)
downloadlinux-dev-e60e5c50aa5389db86e96fc52d02bc7db3d23f4a.tar.xz
linux-dev-e60e5c50aa5389db86e96fc52d02bc7db3d23f4a.zip
[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>
Diffstat (limited to 'fs/buffer.c')
-rw-r--r--fs/buffer.c4
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[])
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);
}
}