mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-02 13:23:35 -04:00
btrfs: open code submit_encoded_read_bio
Open code the functionality in the only caller and remove the now superfluous error handling there. Reviewed-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
committed by
David Sterba
parent
f8a02dc6fd
commit
48253076c3
@@ -9936,17 +9936,6 @@ struct btrfs_encoded_read_private {
|
||||
blk_status_t status;
|
||||
};
|
||||
|
||||
static blk_status_t submit_encoded_read_bio(struct btrfs_inode *inode,
|
||||
struct bio *bio, int mirror_num)
|
||||
{
|
||||
struct btrfs_encoded_read_private *priv = btrfs_bio(bio)->private;
|
||||
struct btrfs_fs_info *fs_info = inode->root->fs_info;
|
||||
|
||||
atomic_inc(&priv->pending);
|
||||
btrfs_submit_bio(fs_info, bio, mirror_num);
|
||||
return BLK_STS_OK;
|
||||
}
|
||||
|
||||
static void btrfs_encoded_read_endio(struct btrfs_bio *bbio)
|
||||
{
|
||||
struct btrfs_encoded_read_private *priv = bbio->private;
|
||||
@@ -9971,6 +9960,7 @@ int btrfs_encoded_read_regular_fill_pages(struct btrfs_inode *inode,
|
||||
u64 file_offset, u64 disk_bytenr,
|
||||
u64 disk_io_size, struct page **pages)
|
||||
{
|
||||
struct btrfs_fs_info *fs_info = inode->root->fs_info;
|
||||
struct btrfs_encoded_read_private priv = {
|
||||
.inode = inode,
|
||||
.file_offset = file_offset,
|
||||
@@ -9999,14 +9989,8 @@ int btrfs_encoded_read_regular_fill_pages(struct btrfs_inode *inode,
|
||||
|
||||
if (!bytes ||
|
||||
bio_add_page(bio, pages[i], bytes, 0) < bytes) {
|
||||
blk_status_t status;
|
||||
|
||||
status = submit_encoded_read_bio(inode, bio, 0);
|
||||
if (status) {
|
||||
WRITE_ONCE(priv.status, status);
|
||||
bio_put(bio);
|
||||
goto out;
|
||||
}
|
||||
atomic_inc(&priv.pending);
|
||||
btrfs_submit_bio(fs_info, bio, 0);
|
||||
bio = NULL;
|
||||
continue;
|
||||
}
|
||||
@@ -10017,7 +10001,6 @@ int btrfs_encoded_read_regular_fill_pages(struct btrfs_inode *inode,
|
||||
}
|
||||
}
|
||||
|
||||
out:
|
||||
if (atomic_dec_return(&priv.pending))
|
||||
io_wait_event(priv.wait, !atomic_read(&priv.pending));
|
||||
/* See btrfs_encoded_read_endio() for ordering. */
|
||||
|
||||
Reference in New Issue
Block a user