btrfs: pass btrfs_inode to btrfs_submit_metadata_bio
The function is for internal interfaces so we should use the btrfs_inode. Reviewed-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
5fcdadc270
commit
644094fd28
@ -766,9 +766,9 @@ static bool should_async_write(struct btrfs_fs_info *fs_info,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void btrfs_submit_metadata_bio(struct inode *inode, struct bio *bio, int mirror_num)
|
void btrfs_submit_metadata_bio(struct btrfs_inode *inode, struct bio *bio, int mirror_num)
|
||||||
{
|
{
|
||||||
struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
|
struct btrfs_fs_info *fs_info = inode->root->fs_info;
|
||||||
struct btrfs_bio *bbio = btrfs_bio(bio);
|
struct btrfs_bio *bbio = btrfs_bio(bio);
|
||||||
blk_status_t ret;
|
blk_status_t ret;
|
||||||
|
|
||||||
@ -783,8 +783,8 @@ void btrfs_submit_metadata_bio(struct inode *inode, struct bio *bio, int mirror_
|
|||||||
* Kthread helpers are used to submit writes so that checksumming can
|
* Kthread helpers are used to submit writes so that checksumming can
|
||||||
* happen in parallel across all CPUs.
|
* happen in parallel across all CPUs.
|
||||||
*/
|
*/
|
||||||
if (should_async_write(fs_info, BTRFS_I(inode)) &&
|
if (should_async_write(fs_info, inode) &&
|
||||||
btrfs_wq_submit_bio(BTRFS_I(inode), bio, mirror_num, 0, WQ_SUBMIT_METADATA))
|
btrfs_wq_submit_bio(inode, bio, mirror_num, 0, WQ_SUBMIT_METADATA))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ret = btree_csum_one_bio(bio);
|
ret = btree_csum_one_bio(bio);
|
||||||
|
@ -86,7 +86,7 @@ void btrfs_drop_and_free_fs_root(struct btrfs_fs_info *fs_info,
|
|||||||
int btrfs_validate_metadata_buffer(struct btrfs_bio *bbio,
|
int btrfs_validate_metadata_buffer(struct btrfs_bio *bbio,
|
||||||
struct page *page, u64 start, u64 end,
|
struct page *page, u64 start, u64 end,
|
||||||
int mirror);
|
int mirror);
|
||||||
void btrfs_submit_metadata_bio(struct inode *inode, struct bio *bio, int mirror_num);
|
void btrfs_submit_metadata_bio(struct btrfs_inode *inode, struct bio *bio, int mirror_num);
|
||||||
#ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS
|
#ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS
|
||||||
struct btrfs_root *btrfs_alloc_dummy_root(struct btrfs_fs_info *fs_info);
|
struct btrfs_root *btrfs_alloc_dummy_root(struct btrfs_fs_info *fs_info);
|
||||||
#endif
|
#endif
|
||||||
|
@ -134,7 +134,7 @@ static void submit_one_bio(struct btrfs_bio_ctrl *bio_ctrl)
|
|||||||
btrfs_bio(bio)->file_offset = page_offset(bv->bv_page) + bv->bv_offset;
|
btrfs_bio(bio)->file_offset = page_offset(bv->bv_page) + bv->bv_offset;
|
||||||
|
|
||||||
if (!is_data_inode(inode))
|
if (!is_data_inode(inode))
|
||||||
btrfs_submit_metadata_bio(inode, bio, mirror_num);
|
btrfs_submit_metadata_bio(BTRFS_I(inode), bio, mirror_num);
|
||||||
else if (btrfs_op(bio) == BTRFS_MAP_WRITE)
|
else if (btrfs_op(bio) == BTRFS_MAP_WRITE)
|
||||||
btrfs_submit_data_write_bio(inode, bio, mirror_num);
|
btrfs_submit_data_write_bio(inode, bio, mirror_num);
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user