diff options
author | Christoph Hellwig <hch@lst.de> | 2022-06-03 09:11:01 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2022-07-25 17:45:34 +0200 |
commit | 2d5ac130fa498d66d91c3aa46c0f87e63664d9e9 (patch) | |
tree | 559ea6fb52544e2756770de3efda52c59ce8e4cd | |
parent | 234fdd2815ce8fe4da6782109580f3b166aeb97b (diff) | |
download | lwn-2d5ac130fa498d66d91c3aa46c0f87e63664d9e9.tar.gz lwn-2d5ac130fa498d66d91c3aa46c0f87e63664d9e9.zip |
btrfs: don't use bio->bi_private to pass the inode to submit_one_bio
submit_one_bio is only used for page cache I/O, so the inode can be
trivially derived from the first page in the bio.
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r-- | fs/btrfs/extent_io.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 5efe25bbee5e..361b18d136c0 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -181,10 +181,7 @@ static int add_extent_changeset(struct extent_state *state, u32 bits, static void submit_one_bio(struct bio *bio, int mirror_num, enum btrfs_compression_type compress_type) { - struct extent_io_tree *tree = bio->bi_private; - struct inode *inode = tree->private_data; - - bio->bi_private = NULL; + struct inode *inode = bio_first_page_all(bio)->mapping->host; /* Caller should ensure the bio has at least some range added */ ASSERT(bio->bi_iter.bi_size); @@ -3362,7 +3359,6 @@ static int alloc_new_bio(struct btrfs_inode *inode, bio_ctrl->bio = bio; bio_ctrl->compress_type = compress_type; bio->bi_end_io = end_io_func; - bio->bi_private = &inode->io_tree; bio->bi_opf = opf; ret = calc_bio_boundaries(bio_ctrl, inode, file_offset); if (ret < 0) |