btrfs: merge btrfs_folio_unlock_writer() into btrfs_folio_end_writer_lock()
PATCH 1/1 btrfs: merge btrfs_folio_unlock_writer() into btrfs_folio_end_writer_lock()
The function btrfs_folio_unlock_writer() is already calling btrfs_folio_end_writer_lock() to do the heavy lifting work, the only missing 0 writer check.
Thus there is no need to keep two different functions, move the 0 writer check into btrfs_folio_end_writer_lock(), and remove btrfs_folio_unlock_writer().
Signed-off-by Qu Wenruo <[email protected]>
--- fs/btrfs/extent_io.c | 2 +- fs/btrfs/subpage.c | 81 +++++++++++++++++++------------------------- fs/btrfs/subpage.h | 2 -- 3 files changed, 35 insertions(+), 50 deletions(-)
fs/btrfs/extent_io.c +1 -1
@@ -2220,7 +2220,7 @@ void extent_write_locked_range(struct inode *inode, const struct folio *locked_f cur, cur_len, !ret);mapping_set_error (mapping, ret); } -btrfs_folio_unlock_writer (fs_info, folio, cur, cur_len); +btrfs_folio_end_writer_lock (fs_info, folio, cur, cur_len);if (ret <0 ) found_error = true; next_page:
fs/btrfs/subpage.c +34 -47
100 lines not on this page · raw message
fs/btrfs/subpage.h +0 -2
@@ -155,8 +155,6 @@ bool btrfs_subpage_clear_and_test_dirty(const struct btrfs_fs_info *fs_info,void btrfs_folio_assert_not_dirty (const struct btrfs_fs_info *fs_info,struct folio *folio,u64 start,u32 len); -void btrfs_folio_unlock_writer (struct btrfs_fs_info *fs_info, -struct folio *folio,u64 start,u32 len);void btrfs_get_subpage_dirty_bitmap (struct btrfs_fs_info *fs_info,struct folio *folio,unsigned long *ret_bitmap);
Signature · 1 line
2.46.0
Quoted 9 lines · Qu Wenruo
The function
btrfs_folio_unlock_writer()is already callingbtrfs_folio_end_writer_lock()to do the heavy lifting work, the only missing 0 writer check.Thus there is no need to keep two different functions, move the 0 writer check into
btrfs_folio_end_writer_lock(), and removebtrfs_folio_unlock_writer().Signed-off-by Qu Wenruo <[email protected]>
Reviewed-by David Sterba <[email protected]>