aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2005-05-05 19:15:48 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-05 19:36:41 -0400
commitf0fbd5fc09b20f7ba7bc8c80be33e39925bb38e1 (patch)
tree01216cf5771d1b49dfc2e0ba15ac1a288fb5d58c /fs
parent05937baae9fc27b64bcd4378da7d2b14edf7931c (diff)
[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>
Diffstat (limited to 'fs')
-rw-r--r--fs/buffer.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/fs/buffer.c b/fs/buffer.c
index 6f2c3303a443..91ace8034bf7 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,
1751 int err; 1751 int err;
1752 sector_t block; 1752 sector_t block;
1753 sector_t last_block; 1753 sector_t last_block;
1754 struct buffer_head *bh, *head, *last_bh = NULL; 1754 struct buffer_head *bh, *head;
1755 int nr_underway = 0; 1755 int nr_underway = 0;
1756 1756
1757 BUG_ON(!PageLocked(page)); 1757 BUG_ON(!PageLocked(page));
@@ -1826,7 +1826,6 @@ static int __block_write_full_page(struct inode *inode, struct page *page,
1826 } 1826 }
1827 if (test_clear_buffer_dirty(bh)) { 1827 if (test_clear_buffer_dirty(bh)) {
1828 mark_buffer_async_write(bh); 1828 mark_buffer_async_write(bh);
1829 last_bh = bh;
1830 } else { 1829 } else {
1831 unlock_buffer(bh); 1830 unlock_buffer(bh);
1832 } 1831 }
@@ -1844,12 +1843,9 @@ static int __block_write_full_page(struct inode *inode, struct page *page,
1844 if (buffer_async_write(bh)) { 1843 if (buffer_async_write(bh)) {
1845 submit_bh(WRITE, bh); 1844 submit_bh(WRITE, bh);
1846 nr_underway++; 1845 nr_underway++;
1847 if (bh == last_bh)
1848 break;
1849 } 1846 }
1850 bh = next; 1847 bh = next;
1851 } while (bh != head); 1848 } while (bh != head);
1852 bh = head;
1853 unlock_page(page); 1849 unlock_page(page);
1854 1850
1855 err = 0; 1851 err = 0;
@@ -1892,7 +1888,6 @@ recover:
1892 if (buffer_mapped(bh) && buffer_dirty(bh)) { 1888 if (buffer_mapped(bh) && buffer_dirty(bh)) {
1893 lock_buffer(bh); 1889 lock_buffer(bh);
1894 mark_buffer_async_write(bh); 1890 mark_buffer_async_write(bh);
1895 last_bh = bh;
1896 } else { 1891 } else {
1897 /* 1892 /*
1898 * The buffer may have been set dirty during 1893 * The buffer may have been set dirty during
@@ -1911,12 +1906,9 @@ recover:
1911 clear_buffer_dirty(bh); 1906 clear_buffer_dirty(bh);
1912 submit_bh(WRITE, bh); 1907 submit_bh(WRITE, bh);
1913 nr_underway++; 1908 nr_underway++;
1914 if (bh == last_bh)
1915 break;
1916 } 1909 }
1917 bh = next; 1910 bh = next;
1918 } while (bh != head); 1911 } while (bh != head);
1919 bh = head;
1920 goto done; 1912 goto done;
1921} 1913}
1922 1914