Skip to content

Commit f42a146

Browse files
adam900710kdave
authored andcommitted
btrfs: remove btrfs_set_range_writeback()
The function btrfs_set_range_writeback() is 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 is only called on a full page, later converted to handle range inside a page. But it never needs to handle multiple pages, and since commit 8189197 ("btrfs: refactor __extent_writepage_io() to do sector-by-sector submission") the function is 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> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 9ca9b86 commit f42a146

File tree

3 files changed

+1
-24
lines changed

3 files changed

+1
-24
lines changed

fs/btrfs/btrfs_inode.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,6 @@ void btrfs_merge_delalloc_extent(struct btrfs_inode *inode, struct extent_state
577577
struct extent_state *other);
578578
void btrfs_split_delalloc_extent(struct btrfs_inode *inode,
579579
struct extent_state *orig, u64 split);
580-
void btrfs_set_range_writeback(struct btrfs_inode *inode, u64 start, u64 end);
581580
void btrfs_evict_inode(struct inode *inode);
582581
struct inode *btrfs_alloc_inode(struct super_block *sb);
583582
void btrfs_destroy_inode(struct inode *inode);

fs/btrfs/extent_io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1359,7 +1359,7 @@ static int submit_one_sector(struct btrfs_inode *inode,
13591359
* a folio for a range already written to disk.
13601360
*/
13611361
btrfs_folio_clear_dirty(fs_info, folio, filepos, sectorsize);
1362-
btrfs_set_range_writeback(inode, filepos, filepos + sectorsize - 1);
1362+
btrfs_folio_set_writeback(fs_info, folio, filepos, sectorsize);
13631363
/*
13641364
* Above call should set the whole folio with writeback flag, even
13651365
* just for a single subpage sector.

fs/btrfs/inode.c

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8963,28 +8963,6 @@ static int btrfs_tmpfile(struct mnt_idmap *idmap, struct inode *dir,
89638963
return finish_open_simple(file, ret);
89648964
}
89658965

8966-
void btrfs_set_range_writeback(struct btrfs_inode *inode, u64 start, u64 end)
8967-
{
8968-
struct btrfs_fs_info *fs_info = inode->root->fs_info;
8969-
unsigned long index = start >> PAGE_SHIFT;
8970-
unsigned long end_index = end >> PAGE_SHIFT;
8971-
struct folio *folio;
8972-
u32 len;
8973-
8974-
ASSERT(end + 1 - start <= U32_MAX);
8975-
len = end + 1 - start;
8976-
while (index <= end_index) {
8977-
folio = __filemap_get_folio(inode->vfs_inode.i_mapping, index, 0, 0);
8978-
ASSERT(!IS_ERR(folio)); /* folios should be in the extent_io_tree */
8979-
8980-
/* This is for data, which doesn't yet support larger folio. */
8981-
ASSERT(folio_order(folio) == 0);
8982-
btrfs_folio_set_writeback(fs_info, folio, start, len);
8983-
folio_put(folio);
8984-
index++;
8985-
}
8986-
}
8987-
89888966
int btrfs_encoded_io_compression_from_extent(struct btrfs_fs_info *fs_info,
89898967
int compress_type)
89908968
{

0 commit comments

Comments
 (0)