diff options
author | Qu Wenruo <wqu@suse.com> | 2021-11-12 13:33:14 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2022-01-03 15:09:45 +0100 |
commit | 83f1b68002c208329412cf9f998c90b3326828d2 (patch) | |
tree | 3618c0d00e9f73598e8fc90917ef5c9f06914b66 /fs/adfs | |
parent | 9270501c163b67f48fd5fb2f98b1b48d6530f460 (diff) | |
download | linux-83f1b68002c208329412cf9f998c90b3326828d2.tar.gz linux-83f1b68002c208329412cf9f998c90b3326828d2.tar.bz2 linux-83f1b68002c208329412cf9f998c90b3326828d2.zip |
btrfs: remove unnecessary @nr_written parameters
We use @nr_written to record how many pages have been started by
btrfs_run_delalloc_range().
Currently there are only two cases that would populate @nr_written:
- Inline extent creation
- Compressed write
But both cases will also set @page_started to one.
In fact, in writepage_delalloc() we have the following code, showing
that @nr_written is really only utilized for above two cases:
/* did the fill delalloc function already unlock and start
* the IO?
*/
if (page_started) {
/*
* we've unlocked the page, so we can't update
* the mapping's writeback index, just update
* nr_to_write.
*/
wbc->nr_to_write -= nr_written;
return 1;
}
But for such cases, writepage_delalloc() will return 1, and exit
__extent_writepage() without going through __extent_writepage_io().
Thus this means, inside __extent_writepage_io(), we always get
@nr_written as 0.
So this patch is going to remove the unnecessary parameter from the
following functions:
- writepage_delalloc()
As @nr_written passed in is always the initial value 0.
Although inside that function, we still need a local @nr_written
to update wbc->nr_to_write.
- __extent_writepage_io()
As explained above, @nr_written passed in can only be 0.
This also means we can remove one update_nr_written() call.
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/adfs')
0 files changed, 0 insertions, 0 deletions