summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/compression.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2022-05-26 09:36:38 +0200
committerDavid Sterba <dsterba@suse.com>2022-07-25 17:45:33 +0200
commitfed8a72df126fdf03bf6bd46d83be9ff3bd90892 (patch)
treea20935c121267f7d62b18d49dc52f07dd2af484e /fs/btrfs/compression.h
parentbtrfs: don't double-defer bio completions for compressed reads (diff)
downloadlinux-fed8a72df126fdf03bf6bd46d83be9ff3bd90892.tar.xz
linux-fed8a72df126fdf03bf6bd46d83be9ff3bd90892.zip
btrfs: don't use btrfs_bio_wq_end_io for compressed writes
Compressed write bio completion is the only user of btrfs_bio_wq_end_io for writes, and the use of btrfs_bio_wq_end_io is a little suboptimal here as we only real need user context for the final completion of a compressed_bio structure, and not every single bio completion. Add a work_struct to struct compressed_bio instead and use that to call finish_compressed_bio_write. This allows to remove all handling of write bios in the btrfs_bio_wq_end_io infrastructure. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/compression.h')
-rw-r--r--fs/btrfs/compression.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/btrfs/compression.h b/fs/btrfs/compression.h
index 2707404389a5..5fca7603e928 100644
--- a/fs/btrfs/compression.h
+++ b/fs/btrfs/compression.h
@@ -61,8 +61,11 @@ struct compressed_bio {
blk_status_t status;
int mirror_num;
- /* for reads, this is the bio we are copying the data into */
- struct bio *orig_bio;
+ union {
+ /* For reads, this is the bio we are copying the data into */
+ struct bio *orig_bio;
+ struct work_struct write_end_work;
+ };
/*
* the start of a variable length array of checksums only