ext4: Use nr_to_write directly in mpage_prepare_extent_to_map()
authorJan Kara <jack@suse.cz>
Tue, 28 Feb 2023 05:13:14 +0000 (00:13 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 23 Mar 2023 14:06:07 +0000 (10:06 -0400)
commitc8e8e16dbbf0840e6f41575c3d6158bd331218bc
tree982c6b05792d3971ceb92deab1405d4c27f10bc0
parent9462f770eda85b754e82b089d8a0d195fa160837
ext4: Use nr_to_write directly in mpage_prepare_extent_to_map()

When looking up extent of pages to map in mpage_prepare_extent_to_map()
we count how many pages we still need to find in a copy of
wbc->nr_to_write counter. With more complex page handling for
data=journal mode, it will be easier to use wbc->nr_to_write directly so
that we don't forget to carry over changes back to nr_to_write counter.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Link: https://lore.kernel.org/r/20230228051319.4085470-3-tytso@mit.edu
fs/ext4/inode.c