diff options
author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2024-02-15 09:36:44 +0300 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2024-02-24 04:48:36 +0300 |
commit | 807d1fe36077decf6f4ef8d4b63a084760a5c5fc (patch) | |
tree | aada37024a42396ccefb080eb0d7c6a4efc1e00a /include/linux/pagevec.h | |
parent | 751e0d559c62a87dc828af22c3c58dc078c734e3 (diff) | |
download | linux-807d1fe36077decf6f4ef8d4b63a084760a5c5fc.tar.xz |
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 'include/linux/pagevec.h')
0 files changed, 0 insertions, 0 deletions