aboutsummaryrefslogtreecommitdiff
path: root/fs/btrfs/bio.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2023-01-21 07:50:20 +0100
committerDavid Sterba <dsterba@suse.com>2023-02-15 19:38:52 +0100
commit852eee62d31abd695cd43e1b875d664ed292a8ca (patch)
treef1aa0ca8c66c12246fdf046b317dd273f2c94a6e /fs/btrfs/bio.h
parent542e300e8398ea529a4a20a125c77d234d5ca37e (diff)
btrfs: allow btrfs_submit_bio to split bios
Currently the I/O submitters have to split bios according to the chunk stripe boundaries. This leads to extra lookups in the extent trees and a lot of boilerplate code. To drop this requirement, split the bio when __btrfs_map_block returns a mapping that is smaller than the requested size and keep a count of pending bios in the original btrfs_bio so that the upper level completion is only invoked when all clones have completed. Based on a patch from Qu Wenruo. Reviewed-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/bio.h')
-rw-r--r--fs/btrfs/bio.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/bio.h b/fs/btrfs/bio.h
index 4142004ce053..67d416cf293d 100644
--- a/fs/btrfs/bio.h
+++ b/fs/btrfs/bio.h
@@ -55,6 +55,7 @@ struct btrfs_bio {
/* For internal use in read end I/O handling */
unsigned int mirror_num;
+ atomic_t pending_ios;
struct work_struct end_io_work;
/*