Skip to content

Commit

Permalink
btrfs: remove trivial helper update_nr_written
Browse files Browse the repository at this point in the history
The helper used to do more with the wbc state but now it's just one
subtraction, no need to have a special helper.

It became trivial in a913266 ("Btrfs: make mapping->writeback_index
point to the last written page").

Reviewed-by: Johannes Thumshirn <[email protected]>
Reviewed-by: Nikolay Borisov <[email protected]>
Signed-off-by: David Sterba <[email protected]>
  • Loading branch information
kdave committed May 16, 2022
1 parent a6f5e39 commit 572f3da
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions fs/btrfs/extent_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -3839,12 +3839,6 @@ static inline void contiguous_readpages(struct page *pages[], int nr_pages,
}
}

static void update_nr_written(struct writeback_control *wbc,
unsigned long nr_written)
{
wbc->nr_to_write -= nr_written;
}

/*
* helper for __extent_writepage, doing all of the delayed allocation setup.
*
Expand Down Expand Up @@ -4007,7 +4001,7 @@ static noinline_for_stack int __extent_writepage_io(struct btrfs_inode *inode,
* we don't want to touch the inode after unlocking the page,
* so we update the mapping writeback index now
*/
update_nr_written(wbc, 1);
wbc->nr_to_write--;

while (cur <= end) {
u64 disk_bytenr;
Expand Down Expand Up @@ -4620,7 +4614,7 @@ static int write_one_subpage_eb(struct extent_buffer *eb,
* dirty anymore, we have submitted a page. Update nr_written in wbc.
*/
if (no_dirty_ebs)
update_nr_written(wbc, 1);
wbc->nr_to_write--;
return ret;
}

Expand Down Expand Up @@ -4656,7 +4650,7 @@ static noinline_for_stack int write_one_eb(struct extent_buffer *eb,
break;
}
disk_bytenr += PAGE_SIZE;
update_nr_written(wbc, 1);
wbc->nr_to_write--;
unlock_page(p);
}

Expand Down

0 comments on commit 572f3da

Please sign in to comment.