diff options
author | Christoph Hellwig <hch@lst.de> | 2023-01-21 07:50:16 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2023-02-15 19:38:52 +0100 |
commit | f8c44673e5a5f5131773d4a6974fb8ea4db033f8 (patch) | |
tree | 4f15a733e78b5b336e2d35ac3ea47bc292a7ce3f /fs/btrfs/bio.c | |
parent | btrfs: open code the submit_bio_start helpers (diff) | |
download | linux-f8c44673e5a5f5131773d4a6974fb8ea4db033f8.tar.xz linux-f8c44673e5a5f5131773d4a6974fb8ea4db033f8.zip |
btrfs: simplify the btrfs_csum_one_bio calling convention
To prepare for further bio submission changes btrfs_csum_one_bio
should be able to take all it's arguments from the btrfs_bio structure.
It can always use the bbio->inode already, and once the compression code
is updated to set ->file_offset that one can be used unconditionally
as well instead of looking at the page mapping now that btrfs doesn't
allow ordered extents to span discontiguous data ranges.
The only slightly tricky bit is the one_ordered flag set by the
compressed writes. Replace that one with the driver private bio
flag, which gets cleared before the bio is handed off to the block layer
so that we don't get in the way of driver use.
Note: this leaves an argument and a flag to btrfs_wq_submit_bio unused.
But that whole mechanism will be removed in its current form in the
next patch.
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/bio.c')
-rw-r--r-- | fs/btrfs/bio.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/btrfs/bio.c b/fs/btrfs/bio.c index d75c11808482..6af0a788c542 100644 --- a/fs/btrfs/bio.c +++ b/fs/btrfs/bio.c @@ -438,6 +438,9 @@ void btrfs_submit_bio(struct btrfs_fs_info *fs_info, struct bio *bio, int mirror goto fail; } + /* Do not leak our private flag into the block layer. */ + bio->bi_opf &= ~REQ_BTRFS_ONE_ORDERED; + if (!bioc) { /* Single mirror read/write fast path */ bbio->mirror_num = mirror_num; |