summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2005-05-05 16:15:48 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-05 16:36:41 -0700
commitf0fbd5fc09b20f7ba7bc8c80be33e39925bb38e1 (patch)
tree01216cf5771d1b49dfc2e0ba15ac1a288fb5d58c
parent05937baae9fc27b64bcd4378da7d2b14edf7931c (diff)
downloadop-kernel-dev-f0fbd5fc09b20f7ba7bc8c80be33e39925bb38e1.zip
op-kernel-dev-f0fbd5fc09b20f7ba7bc8c80be33e39925bb38e1.tar.gz
[PATCH] __block_write_full_page() simplification
The `last_bh' logic probably isn't worth much. In those situations where only the front part of the page is being written out we will save some looping but in the vastly more common case of an all-page writeout if just adds more code. Nick Piggin <nickpiggin@yahoo.com.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--fs/buffer.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/fs/buffer.c b/fs/buffer.c
index 6f2c330..91ace80 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -1751,7 +1751,7 @@ static int __block_write_full_page(struct inode *inode, struct page *page,
int err;
sector_t block;
sector_t last_block;
- struct buffer_head *bh, *head, *last_bh = NULL;
+ struct buffer_head *bh, *head;
int nr_underway = 0;
BUG_ON(!PageLocked(page));
@@ -1826,7 +1826,6 @@ static int __block_write_full_page(struct inode *inode, struct page *page,
}
if (test_clear_buffer_dirty(bh)) {
mark_buffer_async_write(bh);
- last_bh = bh;
} else {
unlock_buffer(bh);
}
@@ -1844,12 +1843,9 @@ static int __block_write_full_page(struct inode *inode, struct page *page,
if (buffer_async_write(bh)) {
submit_bh(WRITE, bh);
nr_underway++;
- if (bh == last_bh)
- break;
}
bh = next;
} while (bh != head);
- bh = head;
unlock_page(page);
err = 0;
@@ -1892,7 +1888,6 @@ recover:
if (buffer_mapped(bh) && buffer_dirty(bh)) {
lock_buffer(bh);
mark_buffer_async_write(bh);
- last_bh = bh;
} else {
/*
* The buffer may have been set dirty during
@@ -1911,12 +1906,9 @@ recover:
clear_buffer_dirty(bh);
submit_bh(WRITE, bh);
nr_underway++;
- if (bh == last_bh)
- break;
}
bh = next;
} while (bh != head);
- bh = head;
goto done;
}
OpenPOWER on IntegriCloud