summaryrefslogtreecommitdiff
path: root/staging/mops_update.c
AgeCommit message (Expand)AuthorFilesLines
2013-05-13staging: add mausezahn staging directoryDaniel Borkmann1-0/+422
m>2016-04-28 10:41:47 +0200 commita91326679f2a0a4c239cd643674fdcda28ee86be (patch) tree5f16ded08debb18f910d87e8fec973f861e5cc72 parent4c63c2454eff996c5e27991221106eb511f7db38 (diff)
Btrfs: make mapping->writeback_index point to the last written page
If sequential writer is writing in the middle of the page and it just redirties the last written page by continuing from it. In the above case this can end up with seeking back to that firstly redirtied page after writing all the pages at the end of file because btrfs updates mapping->writeback_index to 1 past the current one. For non-cow filesystems, the cost is only about extra seek, while for cow filesystems such as btrfs, it means unnecessary fragments. To avoid it, we just need to continue writeback from the last written page. This also updates btrfs to behave like what write_cache_pages() does, ie, bail out immediately if there is an error in writepage(). <Ref: https://www.spinics.net/lists/linux-btrfs/msg52628.html> Reported-by: Holger Hoffstätte <holger.hoffstaette@googlemail.com> Signed-off-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat