Commit 5fcdadc2 authored by David Sterba's avatar David Sterba

btrfs: pass btrfs_inode to btrfs_wq_submit_bio

The function is for internal interfaces so we should use the
btrfs_inode.
Reviewed-by: default avatarAnand Jain <anand.jain@oracle.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent bfa17066
...@@ -698,17 +698,17 @@ static void run_one_async_free(struct btrfs_work *work) ...@@ -698,17 +698,17 @@ static void run_one_async_free(struct btrfs_work *work)
* - true if the work has been succesfuly submitted * - true if the work has been succesfuly submitted
* - false in case of error * - false in case of error
*/ */
bool btrfs_wq_submit_bio(struct inode *inode, struct bio *bio, int mirror_num, bool btrfs_wq_submit_bio(struct btrfs_inode *inode, struct bio *bio, int mirror_num,
u64 dio_file_offset, enum btrfs_wq_submit_cmd cmd) u64 dio_file_offset, enum btrfs_wq_submit_cmd cmd)
{ {
struct btrfs_fs_info *fs_info = BTRFS_I(inode)->root->fs_info; struct btrfs_fs_info *fs_info = inode->root->fs_info;
struct async_submit_bio *async; struct async_submit_bio *async;
async = kmalloc(sizeof(*async), GFP_NOFS); async = kmalloc(sizeof(*async), GFP_NOFS);
if (!async) if (!async)
return false; return false;
async->inode = BTRFS_I(inode); async->inode = inode;
async->bio = bio; async->bio = bio;
async->mirror_num = mirror_num; async->mirror_num = mirror_num;
async->submit_cmd = cmd; async->submit_cmd = cmd;
...@@ -784,7 +784,7 @@ void btrfs_submit_metadata_bio(struct inode *inode, struct bio *bio, int mirror_ ...@@ -784,7 +784,7 @@ void btrfs_submit_metadata_bio(struct inode *inode, struct bio *bio, int mirror_
* 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, BTRFS_I(inode)) &&
btrfs_wq_submit_bio(inode, bio, mirror_num, 0, WQ_SUBMIT_METADATA)) btrfs_wq_submit_bio(BTRFS_I(inode), bio, mirror_num, 0, WQ_SUBMIT_METADATA))
return; return;
ret = btree_csum_one_bio(bio); ret = btree_csum_one_bio(bio);
......
...@@ -120,7 +120,7 @@ enum btrfs_wq_submit_cmd { ...@@ -120,7 +120,7 @@ enum btrfs_wq_submit_cmd {
WQ_SUBMIT_DATA_DIO, WQ_SUBMIT_DATA_DIO,
}; };
bool btrfs_wq_submit_bio(struct inode *inode, struct bio *bio, int mirror_num, bool btrfs_wq_submit_bio(struct btrfs_inode *inode, struct bio *bio, int mirror_num,
u64 dio_file_offset, enum btrfs_wq_submit_cmd cmd); u64 dio_file_offset, enum btrfs_wq_submit_cmd cmd);
blk_status_t btree_submit_bio_start(struct bio *bio); blk_status_t btree_submit_bio_start(struct bio *bio);
int btrfs_alloc_log_tree_node(struct btrfs_trans_handle *trans, int btrfs_alloc_log_tree_node(struct btrfs_trans_handle *trans,
......
...@@ -2757,7 +2757,7 @@ void btrfs_submit_data_write_bio(struct inode *inode, struct bio *bio, int mirro ...@@ -2757,7 +2757,7 @@ void btrfs_submit_data_write_bio(struct inode *inode, struct bio *bio, int mirro
!test_bit(BTRFS_FS_STATE_NO_CSUMS, &fs_info->fs_state) && !test_bit(BTRFS_FS_STATE_NO_CSUMS, &fs_info->fs_state) &&
!btrfs_is_data_reloc_root(bi->root)) { !btrfs_is_data_reloc_root(bi->root)) {
if (!atomic_read(&bi->sync_writers) && if (!atomic_read(&bi->sync_writers) &&
btrfs_wq_submit_bio(inode, bio, mirror_num, 0, WQ_SUBMIT_DATA)) btrfs_wq_submit_bio(bi, bio, mirror_num, 0, WQ_SUBMIT_DATA))
return; return;
ret = btrfs_csum_one_bio(bi, bio, (u64)-1, false); ret = btrfs_csum_one_bio(bi, bio, (u64)-1, false);
...@@ -8014,7 +8014,7 @@ static void btrfs_submit_dio_bio(struct bio *bio, struct inode *inode, ...@@ -8014,7 +8014,7 @@ static void btrfs_submit_dio_bio(struct bio *bio, struct inode *inode,
if (btrfs_op(bio) == BTRFS_MAP_WRITE) { if (btrfs_op(bio) == BTRFS_MAP_WRITE) {
/* Check btrfs_submit_data_write_bio() for async submit rules */ /* Check btrfs_submit_data_write_bio() for async submit rules */
if (async_submit && !atomic_read(&BTRFS_I(inode)->sync_writers) && if (async_submit && !atomic_read(&BTRFS_I(inode)->sync_writers) &&
btrfs_wq_submit_bio(inode, bio, 0, file_offset, btrfs_wq_submit_bio(BTRFS_I(inode), bio, 0, file_offset,
WQ_SUBMIT_DATA_DIO)) WQ_SUBMIT_DATA_DIO))
return; return;
......
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