aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorGravatar Matthew Wilcox (Oracle) <willy@infradead.org> 2024-02-15 07:36:44 +0100
committerGravatar Andrew Morton <akpm@linux-foundation.org> 2024-02-23 17:48:36 -0800
commit807d1fe36077decf6f4ef8d4b63a084760a5c5fc (patch)
treeaada37024a42396ccefb080eb0d7c6a4efc1e00a /tools
parentwriteback: factor writeback_get_batch() out of write_cache_pages() (diff)
downloadlinux-807d1fe36077decf6f4ef8d4b63a084760a5c5fc.tar.gz
linux-807d1fe36077decf6f4ef8d4b63a084760a5c5fc.tar.bz2
linux-807d1fe36077decf6f4ef8d4b63a084760a5c5fc.zip
writeback: simplify the loops in write_cache_pages()
Collapse the two nested loops into one. This is needed as a step towards turning this into an iterator. Note that this drops the "index <= end" check in the previous outer loop and just relies on filemap_get_folios_tag() to return 0 entries when index > end. This actually has a subtle implication when end == -1 because then the returned index will be -1 as well and thus if there is page present on index -1, we could be looping indefinitely. But as the comment in filemap_get_folios_tag documents this as already broken anyway we should not worry about it here either. The fix for that would probably a change to the filemap_get_folios_tag() calling convention. [hch@lst.de: update the commit log per Jan] Link: https://lkml.kernel.org/r/20240215063649.2164017-10-hch@lst.de Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Jan Kara <jack@suse.cz> Acked-by: Dave Chinner <dchinner@redhat.com> Cc: Christian Brauner <brauner@kernel.org> Cc: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions