From: Jan Kara Date: Fri, 12 Apr 2013 03:48:32 +0000 (-0400) Subject: ext4: make ext4_bio_write_page() use BH_Async_Write flags X-Git-Tag: omap-for-v3.10/dt-fixes-for-merge-window~83^2~17 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0058f9658c94037173f7603fc8bae2007cc10253;p=pandora-kernel.git ext4: make ext4_bio_write_page() use BH_Async_Write flags So far ext4_bio_write_page() attached all the pages to ext4_io_end structure. This makes that structure pretty heavy (1 KB for pointers + 16 bytes per page attached to the bio). Also later we would like to share ext4_io_end structure among several bios in case IO to a single extent needs to be split among several bios and pointing to pages from ext4_io_end makes this complex. We remove page pointers from ext4_io_end and use pointers from bio itself instead. This isn't as easy when blocksize < pagesize because then we can have several bios in flight for a single page and we have to be careful when to call end_page_writeback(). However this is a known problem already solved by block_write_full_page() / end_buffer_async_write() so we mimic its behavior here. We mark buffers going to disk with BH_Async_Write flag and in ext4_bio_end_io() we check whether there are any buffers with BH_Async_Write flag left. If there are not, we can call end_page_writeback(). Signed-off-by: Jan Kara Signed-off-by: "Theodore Ts'o" Reviewed-by: Dmitry Monakhov Reviewed-by: Zheng Liu --- Reading git-diff-tree failed