mirror of
https://github.com/torvalds/linux.git
synced 2024-11-01 13:03:25 +01:00
btrfs: rename btrfs_submit_bio() to btrfs_submit_bbio()
The function name is a bit misleading as it submits the btrfs_bio (bbio), rename it so we can use btrfs_submit_bio() when an actual bio is submitted. Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
ce4a71ee15
commit
792e86ef31
7 changed files with 21 additions and 21 deletions
|
@ -53,7 +53,7 @@ void btrfs_bio_init(struct btrfs_bio *bbio, struct btrfs_fs_info *fs_info,
|
|||
|
||||
/*
|
||||
* Allocate a btrfs_bio structure. The btrfs_bio is the main I/O container for
|
||||
* btrfs, and is used for all I/O submitted through btrfs_submit_bio.
|
||||
* btrfs, and is used for all I/O submitted through btrfs_submit_bbio().
|
||||
*
|
||||
* Just like the underlying bio_alloc_bioset it will not fail as it is backed by
|
||||
* a mempool.
|
||||
|
@ -211,7 +211,7 @@ static void btrfs_end_repair_bio(struct btrfs_bio *repair_bbio,
|
|||
goto done;
|
||||
}
|
||||
|
||||
btrfs_submit_bio(repair_bbio, mirror);
|
||||
btrfs_submit_bbio(repair_bbio, mirror);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -280,7 +280,7 @@ static struct btrfs_failed_bio *repair_one_sector(struct btrfs_bio *failed_bbio,
|
|||
|
||||
mirror = next_repair_mirror(fbio, failed_bbio->mirror_num);
|
||||
btrfs_debug(fs_info, "submitting repair read to mirror %d", mirror);
|
||||
btrfs_submit_bio(repair_bbio, mirror);
|
||||
btrfs_submit_bbio(repair_bbio, mirror);
|
||||
return fbio;
|
||||
}
|
||||
|
||||
|
@ -777,7 +777,7 @@ static bool btrfs_submit_chunk(struct btrfs_bio *bbio, int mirror_num)
|
|||
return true;
|
||||
}
|
||||
|
||||
void btrfs_submit_bio(struct btrfs_bio *bbio, int mirror_num)
|
||||
void btrfs_submit_bbio(struct btrfs_bio *bbio, int mirror_num)
|
||||
{
|
||||
/* If bbio->inode is not populated, its file_offset must be 0. */
|
||||
ASSERT(bbio->inode || bbio->file_offset == 0);
|
||||
|
@ -789,7 +789,7 @@ void btrfs_submit_bio(struct btrfs_bio *bbio, int mirror_num)
|
|||
/*
|
||||
* Submit a repair write.
|
||||
*
|
||||
* This bypasses btrfs_submit_bio deliberately, as that writes all copies in a
|
||||
* This bypasses btrfs_submit_bbio() deliberately, as that writes all copies in a
|
||||
* RAID setup. Here we only want to write the one bad copy, so we do the
|
||||
* mapping ourselves and submit the bio directly.
|
||||
*
|
||||
|
|
|
@ -29,7 +29,7 @@ typedef void (*btrfs_bio_end_io_t)(struct btrfs_bio *bbio);
|
|||
|
||||
/*
|
||||
* Highlevel btrfs I/O structure. It is allocated by btrfs_bio_alloc and
|
||||
* passed to btrfs_submit_bio for mapping to the physical devices.
|
||||
* passed to btrfs_submit_bbio() for mapping to the physical devices.
|
||||
*/
|
||||
struct btrfs_bio {
|
||||
/*
|
||||
|
@ -42,7 +42,7 @@ struct btrfs_bio {
|
|||
union {
|
||||
/*
|
||||
* For data reads: checksumming and original I/O information.
|
||||
* (for internal use in the btrfs_submit_bio machinery only)
|
||||
* (for internal use in the btrfs_submit_bbio() machinery only)
|
||||
*/
|
||||
struct {
|
||||
u8 *csum;
|
||||
|
@ -104,7 +104,7 @@ void btrfs_bio_end_io(struct btrfs_bio *bbio, blk_status_t status);
|
|||
/* Submit using blkcg_punt_bio_submit. */
|
||||
#define REQ_BTRFS_CGROUP_PUNT REQ_FS_PRIVATE
|
||||
|
||||
void btrfs_submit_bio(struct btrfs_bio *bbio, int mirror_num);
|
||||
void btrfs_submit_bbio(struct btrfs_bio *bbio, int mirror_num);
|
||||
void btrfs_submit_repair_write(struct btrfs_bio *bbio, int mirror_num, bool dev_replace);
|
||||
int btrfs_repair_io_failure(struct btrfs_fs_info *fs_info, u64 ino, u64 start,
|
||||
u64 length, u64 logical, struct folio *folio,
|
||||
|
|
|
@ -395,7 +395,7 @@ void btrfs_submit_compressed_write(struct btrfs_ordered_extent *ordered,
|
|||
cb->bbio.ordered = ordered;
|
||||
btrfs_add_compressed_bio_folios(cb);
|
||||
|
||||
btrfs_submit_bio(&cb->bbio, 0);
|
||||
btrfs_submit_bbio(&cb->bbio, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -630,7 +630,7 @@ void btrfs_submit_compressed_read(struct btrfs_bio *bbio)
|
|||
if (memstall)
|
||||
psi_memstall_leave(&pflags);
|
||||
|
||||
btrfs_submit_bio(&cb->bbio, 0);
|
||||
btrfs_submit_bbio(&cb->bbio, 0);
|
||||
return;
|
||||
|
||||
out_free_compressed_pages:
|
||||
|
|
|
@ -726,7 +726,7 @@ static void btrfs_dio_submit_io(const struct iomap_iter *iter, struct bio *bio,
|
|||
}
|
||||
}
|
||||
|
||||
btrfs_submit_bio(bbio, 0);
|
||||
btrfs_submit_bbio(bbio, 0);
|
||||
}
|
||||
|
||||
static const struct iomap_ops btrfs_dio_iomap_ops = {
|
||||
|
|
|
@ -117,7 +117,7 @@ static void submit_one_bio(struct btrfs_bio_ctrl *bio_ctrl)
|
|||
bio_ctrl->compress_type != BTRFS_COMPRESS_NONE)
|
||||
btrfs_submit_compressed_read(bbio);
|
||||
else
|
||||
btrfs_submit_bio(bbio, 0);
|
||||
btrfs_submit_bbio(bbio, 0);
|
||||
|
||||
/* The bbio is owned by the end_io handler now */
|
||||
bio_ctrl->bbio = NULL;
|
||||
|
@ -1800,7 +1800,7 @@ static noinline_for_stack void write_one_eb(struct extent_buffer *eb,
|
|||
folio_unlock(folio);
|
||||
}
|
||||
}
|
||||
btrfs_submit_bio(bbio, 0);
|
||||
btrfs_submit_bbio(bbio, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -3572,7 +3572,7 @@ int read_extent_buffer_pages(struct extent_buffer *eb, int wait, int mirror_num,
|
|||
ASSERT(ret);
|
||||
}
|
||||
}
|
||||
btrfs_submit_bio(bbio, mirror_num);
|
||||
btrfs_submit_bbio(bbio, mirror_num);
|
||||
|
||||
done:
|
||||
if (wait == WAIT_COMPLETE) {
|
||||
|
|
|
@ -9152,7 +9152,7 @@ int btrfs_encoded_read_regular_fill_pages(struct btrfs_inode *inode,
|
|||
|
||||
if (bio_add_page(&bbio->bio, pages[i], bytes, 0) < bytes) {
|
||||
atomic_inc(&priv.pending);
|
||||
btrfs_submit_bio(bbio, 0);
|
||||
btrfs_submit_bbio(bbio, 0);
|
||||
|
||||
bbio = btrfs_bio_alloc(BIO_MAX_VECS, REQ_OP_READ, fs_info,
|
||||
btrfs_encoded_read_endio, &priv);
|
||||
|
@ -9167,7 +9167,7 @@ int btrfs_encoded_read_regular_fill_pages(struct btrfs_inode *inode,
|
|||
} while (disk_io_size);
|
||||
|
||||
atomic_inc(&priv.pending);
|
||||
btrfs_submit_bio(bbio, 0);
|
||||
btrfs_submit_bbio(bbio, 0);
|
||||
|
||||
if (atomic_dec_return(&priv.pending))
|
||||
io_wait_event(priv.wait, !atomic_read(&priv.pending));
|
||||
|
|
|
@ -838,7 +838,7 @@ static void scrub_stripe_submit_repair_read(struct scrub_stripe *stripe,
|
|||
bbio->bio.bi_iter.bi_size >= blocksize)) {
|
||||
ASSERT(bbio->bio.bi_iter.bi_size);
|
||||
atomic_inc(&stripe->pending_io);
|
||||
btrfs_submit_bio(bbio, mirror);
|
||||
btrfs_submit_bbio(bbio, mirror);
|
||||
if (wait)
|
||||
wait_scrub_stripe_io(stripe);
|
||||
bbio = NULL;
|
||||
|
@ -857,7 +857,7 @@ static void scrub_stripe_submit_repair_read(struct scrub_stripe *stripe,
|
|||
if (bbio) {
|
||||
ASSERT(bbio->bio.bi_iter.bi_size);
|
||||
atomic_inc(&stripe->pending_io);
|
||||
btrfs_submit_bio(bbio, mirror);
|
||||
btrfs_submit_bbio(bbio, mirror);
|
||||
if (wait)
|
||||
wait_scrub_stripe_io(stripe);
|
||||
}
|
||||
|
@ -1683,7 +1683,7 @@ static void scrub_submit_extent_sector_read(struct scrub_ctx *sctx,
|
|||
bbio->bio.bi_iter.bi_size >= stripe_len)) {
|
||||
ASSERT(bbio->bio.bi_iter.bi_size);
|
||||
atomic_inc(&stripe->pending_io);
|
||||
btrfs_submit_bio(bbio, mirror);
|
||||
btrfs_submit_bbio(bbio, mirror);
|
||||
bbio = NULL;
|
||||
}
|
||||
|
||||
|
@ -1720,7 +1720,7 @@ static void scrub_submit_extent_sector_read(struct scrub_ctx *sctx,
|
|||
if (bbio) {
|
||||
ASSERT(bbio->bio.bi_iter.bi_size);
|
||||
atomic_inc(&stripe->pending_io);
|
||||
btrfs_submit_bio(bbio, mirror);
|
||||
btrfs_submit_bbio(bbio, mirror);
|
||||
}
|
||||
|
||||
if (atomic_dec_and_test(&stripe->pending_io)) {
|
||||
|
@ -1776,7 +1776,7 @@ static void scrub_submit_initial_read(struct scrub_ctx *sctx,
|
|||
|
||||
mirror = calc_next_mirror(mirror, num_copies);
|
||||
}
|
||||
btrfs_submit_bio(bbio, mirror);
|
||||
btrfs_submit_bbio(bbio, mirror);
|
||||
}
|
||||
|
||||
static bool stripe_has_metadata_error(struct scrub_stripe *stripe)
|
||||
|
|
Loading…
Reference in a new issue