Commit a994310a authored by Christoph Hellwig's avatar Christoph Hellwig Committed by David Sterba

btrfs: remove PAGE_SET_ERROR

Now that the btrfs writeback code has stopped using PageError, using
PAGE_SET_ERROR to just set the per-address_space error flag is confusing.
Open code the mapping_set_error calls in the callers and remove
the PAGE_SET_ERROR flag.
Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 2b2553f1
...@@ -268,9 +268,6 @@ static int __process_pages_contig(struct address_space *mapping, ...@@ -268,9 +268,6 @@ static int __process_pages_contig(struct address_space *mapping,
ASSERT(processed_end && *processed_end == start); ASSERT(processed_end && *processed_end == start);
} }
if ((page_ops & PAGE_SET_ERROR) && start_index <= end_index)
mapping_set_error(mapping, -EIO);
folio_batch_init(&fbatch); folio_batch_init(&fbatch);
while (index <= end_index) { while (index <= end_index) {
int found_folios; int found_folios;
......
...@@ -40,7 +40,6 @@ enum { ...@@ -40,7 +40,6 @@ enum {
ENUM_BIT(PAGE_START_WRITEBACK), ENUM_BIT(PAGE_START_WRITEBACK),
ENUM_BIT(PAGE_END_WRITEBACK), ENUM_BIT(PAGE_END_WRITEBACK),
ENUM_BIT(PAGE_SET_ORDERED), ENUM_BIT(PAGE_SET_ORDERED),
ENUM_BIT(PAGE_SET_ERROR),
ENUM_BIT(PAGE_LOCK), ENUM_BIT(PAGE_LOCK),
}; };
......
...@@ -835,6 +835,7 @@ static noinline int compress_file_range(struct async_chunk *async_chunk) ...@@ -835,6 +835,7 @@ static noinline int compress_file_range(struct async_chunk *async_chunk)
{ {
struct btrfs_inode *inode = async_chunk->inode; struct btrfs_inode *inode = async_chunk->inode;
struct btrfs_fs_info *fs_info = inode->root->fs_info; struct btrfs_fs_info *fs_info = inode->root->fs_info;
struct address_space *mapping = inode->vfs_inode.i_mapping;
u64 blocksize = fs_info->sectorsize; u64 blocksize = fs_info->sectorsize;
u64 start = async_chunk->start; u64 start = async_chunk->start;
u64 end = async_chunk->end; u64 end = async_chunk->end;
...@@ -949,7 +950,7 @@ static noinline int compress_file_range(struct async_chunk *async_chunk) ...@@ -949,7 +950,7 @@ static noinline int compress_file_range(struct async_chunk *async_chunk)
/* Compression level is applied here and only here */ /* Compression level is applied here and only here */
ret = btrfs_compress_pages( ret = btrfs_compress_pages(
compress_type | (fs_info->compress_level << 4), compress_type | (fs_info->compress_level << 4),
inode->vfs_inode.i_mapping, start, mapping, start,
pages, pages,
&nr_pages, &nr_pages,
&total_in, &total_in,
...@@ -992,9 +993,9 @@ static noinline int compress_file_range(struct async_chunk *async_chunk) ...@@ -992,9 +993,9 @@ static noinline int compress_file_range(struct async_chunk *async_chunk)
unsigned long clear_flags = EXTENT_DELALLOC | unsigned long clear_flags = EXTENT_DELALLOC |
EXTENT_DELALLOC_NEW | EXTENT_DEFRAG | EXTENT_DELALLOC_NEW | EXTENT_DEFRAG |
EXTENT_DO_ACCOUNTING; EXTENT_DO_ACCOUNTING;
unsigned long page_error_op;
page_error_op = ret < 0 ? PAGE_SET_ERROR : 0; if (ret < 0)
mapping_set_error(mapping, -EIO);
/* /*
* inline extent creation worked or returned error, * inline extent creation worked or returned error,
...@@ -1011,7 +1012,6 @@ static noinline int compress_file_range(struct async_chunk *async_chunk) ...@@ -1011,7 +1012,6 @@ static noinline int compress_file_range(struct async_chunk *async_chunk)
clear_flags, clear_flags,
PAGE_UNLOCK | PAGE_UNLOCK |
PAGE_START_WRITEBACK | PAGE_START_WRITEBACK |
page_error_op |
PAGE_END_WRITEBACK); PAGE_END_WRITEBACK);
/* /*
...@@ -1271,12 +1271,13 @@ static int submit_one_async_extent(struct btrfs_inode *inode, ...@@ -1271,12 +1271,13 @@ static int submit_one_async_extent(struct btrfs_inode *inode,
btrfs_dec_block_group_reservations(fs_info, ins.objectid); btrfs_dec_block_group_reservations(fs_info, ins.objectid);
btrfs_free_reserved_extent(fs_info, ins.objectid, ins.offset, 1); btrfs_free_reserved_extent(fs_info, ins.objectid, ins.offset, 1);
out_free: out_free:
mapping_set_error(inode->vfs_inode.i_mapping, -EIO);
extent_clear_unlock_delalloc(inode, start, end, extent_clear_unlock_delalloc(inode, start, end,
NULL, EXTENT_LOCKED | EXTENT_DELALLOC | NULL, EXTENT_LOCKED | EXTENT_DELALLOC |
EXTENT_DELALLOC_NEW | EXTENT_DELALLOC_NEW |
EXTENT_DEFRAG | EXTENT_DO_ACCOUNTING, EXTENT_DEFRAG | EXTENT_DO_ACCOUNTING,
PAGE_UNLOCK | PAGE_START_WRITEBACK | PAGE_UNLOCK | PAGE_START_WRITEBACK |
PAGE_END_WRITEBACK | PAGE_SET_ERROR); PAGE_END_WRITEBACK);
free_async_extent_pages(async_extent); free_async_extent_pages(async_extent);
goto done; goto done;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment