diff mbox series

[05/40] btrfs: switch async_submit_bio::inode to btrfs_inode

Message ID 675be97c9169d16010f6cd008a835e8f937777f6.1667331828.git.dsterba@suse.com (mailing list archive)
State New, archived
Headers show
Series Parameter and type changes to btrfs_inode | expand

Commit Message

David Sterba Nov. 1, 2022, 8:11 p.m. UTC
The async bio submit is for internal interfaces so we should use the
btrfs_inode.

Signed-off-by: David Sterba <dsterba@suse.com>
---
 fs/btrfs/disk-io.c | 14 +++++++-------
 fs/btrfs/inode.c   |  2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 6ae9d63036ce..51e98e0997d5 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -84,7 +84,7 @@  static void btrfs_free_csum_hash(struct btrfs_fs_info *fs_info)
  * just before they are sent down the IO stack.
  */
 struct async_submit_bio {
-	struct inode *inode;
+	struct btrfs_inode *inode;
 	struct bio *bio;
 	enum btrfs_wq_submit_cmd submit_cmd;
 	int mirror_num;
@@ -642,11 +642,11 @@  static void run_one_async_start(struct btrfs_work *work)
 		ret = btree_submit_bio_start(async->bio);
 		break;
 	case WQ_SUBMIT_DATA:
-		ret = btrfs_submit_bio_start(async->inode, async->bio);
+		ret = btrfs_submit_bio_start(&async->inode->vfs_inode, async->bio);
 		break;
 	case WQ_SUBMIT_DATA_DIO:
-		ret = btrfs_submit_bio_start_direct_io(async->inode, async->bio,
-						       async->dio_file_offset);
+		ret = btrfs_submit_bio_start_direct_io(&async->inode->vfs_inode,
+				async->bio, async->dio_file_offset);
 		break;
 	}
 	if (ret)
@@ -665,7 +665,7 @@  static void run_one_async_done(struct btrfs_work *work)
 {
 	struct async_submit_bio *async =
 		container_of(work, struct  async_submit_bio, work);
-	struct inode *inode = async->inode;
+	struct btrfs_inode *inode = async->inode;
 	struct btrfs_bio *bbio = btrfs_bio(async->bio);
 
 	/* If an error occurred we just want to clean up the bio and move on */
@@ -680,7 +680,7 @@  static void run_one_async_done(struct btrfs_work *work)
 	 * This changes nothing when cgroups aren't in use.
 	 */
 	async->bio->bi_opf |= REQ_CGROUP_PUNT;
-	btrfs_submit_bio(btrfs_sb(inode->i_sb), async->bio, async->mirror_num);
+	btrfs_submit_bio(inode->root->fs_info, async->bio, async->mirror_num);
 }
 
 static void run_one_async_free(struct btrfs_work *work)
@@ -708,7 +708,7 @@  bool btrfs_wq_submit_bio(struct inode *inode, struct bio *bio, int mirror_num,
 	if (!async)
 		return false;
 
-	async->inode = inode;
+	async->inode = BTRFS_I(inode);
 	async->bio = bio;
 	async->mirror_num = mirror_num;
 	async->submit_cmd = cmd;
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 2a61b610e02b..b7cc5cfcf220 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -2550,7 +2550,7 @@  void btrfs_clear_delalloc_extent(struct inode *vfs_inode,
  * At IO completion time the cums attached on the ordered extent record
  * are inserted into the btree
  */
-blk_status_t btrfs_submit_bio_start(struct inode *inode, struct bio *bio);
+blk_status_t btrfs_submit_bio_start(struct inode *inode, struct bio *bio)
 {
 	return btrfs_csum_one_bio(BTRFS_I(inode), bio, (u64)-1, false);
 }