]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
btrfs: remove btrfs_set_range_writeback()
authorQu Wenruo <wqu@suse.com>
Sun, 6 Oct 2024 00:06:20 +0000 (10:36 +1030)
committerDavid Sterba <dsterba@suse.com>
Mon, 11 Nov 2024 13:34:15 +0000 (14:34 +0100)
The function btrfs_set_range_writeback() was originally a callback for
metadata and data, to mark a range with writeback flag.

Then it was converted into a common function call for both metadata and
data.

From the very beginning, the function had been only called on a full page,
later converted to handle range inside a page.

But it never needed to handle multiple pages, and since commit
8189197425e7 ("btrfs: refactor __extent_writepage_io() to do
sector-by-sector submission") the function was only called on a
sector-by-sector basis.

This makes the function unnecessary, and can be converted to a simple
btrfs_folio_set_writeback() call instead.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/btrfs_inode.h
fs/btrfs/extent_io.c
fs/btrfs/inode.c

index e152fde888fc9acd2a27e475fcfb20b862c4673a..c514bab532fafd83089b7c1c4151a520b52dff0c 100644 (file)
@@ -577,7 +577,6 @@ void btrfs_merge_delalloc_extent(struct btrfs_inode *inode, struct extent_state
                                 struct extent_state *other);
 void btrfs_split_delalloc_extent(struct btrfs_inode *inode,
                                 struct extent_state *orig, u64 split);
-void btrfs_set_range_writeback(struct btrfs_inode *inode, u64 start, u64 end);
 void btrfs_evict_inode(struct inode *inode);
 struct inode *btrfs_alloc_inode(struct super_block *sb);
 void btrfs_destroy_inode(struct inode *inode);
index 6aa39e0be2e8ea681961efad24ab79095241716a..bfa745258e9b8ce313a123c8ceb273a8e97a04d5 100644 (file)
@@ -1360,7 +1360,7 @@ static int submit_one_sector(struct btrfs_inode *inode,
         * a folio for a range already written to disk.
         */
        btrfs_folio_clear_dirty(fs_info, folio, filepos, sectorsize);
-       btrfs_set_range_writeback(inode, filepos, filepos + sectorsize - 1);
+       btrfs_folio_set_writeback(fs_info, folio, filepos, sectorsize);
        /*
         * Above call should set the whole folio with writeback flag, even
         * just for a single subpage sector.
index 8da5e47db751ae1f1d4fc8dd99b0bc3778545b3f..3404e7043dac8b16d33e90fe5ef4199616676b18 100644 (file)
@@ -8941,28 +8941,6 @@ out_inode:
        return finish_open_simple(file, ret);
 }
 
-void btrfs_set_range_writeback(struct btrfs_inode *inode, u64 start, u64 end)
-{
-       struct btrfs_fs_info *fs_info = inode->root->fs_info;
-       unsigned long index = start >> PAGE_SHIFT;
-       unsigned long end_index = end >> PAGE_SHIFT;
-       struct folio *folio;
-       u32 len;
-
-       ASSERT(end + 1 - start <= U32_MAX);
-       len = end + 1 - start;
-       while (index <= end_index) {
-               folio = __filemap_get_folio(inode->vfs_inode.i_mapping, index, 0, 0);
-               ASSERT(!IS_ERR(folio)); /* folios should be in the extent_io_tree */
-
-               /* This is for data, which doesn't yet support larger folio. */
-               ASSERT(folio_order(folio) == 0);
-               btrfs_folio_set_writeback(fs_info, folio, start, len);
-               folio_put(folio);
-               index++;
-       }
-}
-
 int btrfs_encoded_io_compression_from_extent(struct btrfs_fs_info *fs_info,
                                             int compress_type)
 {