diff options
author | David Sterba <dsterba@suse.com> | 2022-10-27 02:41:32 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2022-12-05 18:00:52 +0100 |
commit | 5fcdadc2704534ef3a7b99aef65d54183c723493 (patch) | |
tree | 3b5550e6cd92dcf4f30551ae2f2f8d6fc165d136 /fs/btrfs | |
parent | bfa17066822cead4fb8a6a5d4a214a2c527e4614 (diff) |
btrfs: pass btrfs_inode to btrfs_wq_submit_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>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/disk-io.c | 8 | ||||
-rw-r--r-- | fs/btrfs/disk-io.h | 2 | ||||
-rw-r--r-- | fs/btrfs/inode.c | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 5aacb88069a7..65c168d6ed77 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -698,17 +698,17 @@ static void run_one_async_free(struct btrfs_work *work) * - true if the work has been succesfuly submitted * - 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) { - 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; async = kmalloc(sizeof(*async), GFP_NOFS); if (!async) return false; - async->inode = BTRFS_I(inode); + async->inode = inode; async->bio = bio; async->mirror_num = mirror_num; async->submit_cmd = cmd; @@ -784,7 +784,7 @@ void btrfs_submit_metadata_bio(struct inode *inode, struct bio *bio, int mirror_ * happen in parallel across all CPUs. */ 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; ret = btree_csum_one_bio(bio); diff --git a/fs/btrfs/disk-io.h b/fs/btrfs/disk-io.h index d5b25fa8037b..65cf976b74e8 100644 --- a/fs/btrfs/disk-io.h +++ b/fs/btrfs/disk-io.h @@ -120,7 +120,7 @@ enum btrfs_wq_submit_cmd { 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); blk_status_t btree_submit_bio_start(struct bio *bio); int btrfs_alloc_log_tree_node(struct btrfs_trans_handle *trans, diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 06ec84be4b51..a7cbbfc22329 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -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) && !btrfs_is_data_reloc_root(bi->root)) { 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; 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, if (btrfs_op(bio) == BTRFS_MAP_WRITE) { /* Check btrfs_submit_data_write_bio() for async submit rules */ 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)) return; |