Skip to content

Commit

Permalink
btrfs: rename btrfs_submit_bio() to btrfs_submit_bbio()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David Sterba <[email protected]>
  • Loading branch information
kdave committed Sep 10, 2024
1 parent ce4a71e commit 792e86e
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 deletions.
10 changes: 5 additions & 5 deletions fs/btrfs/bio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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);
Expand All @@ -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.
*
Expand Down
6 changes: 3 additions & 3 deletions fs/btrfs/bio.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
/*
Expand All @@ -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;
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions fs/btrfs/compression.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/*
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion fs/btrfs/direct-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
6 changes: 3 additions & 3 deletions fs/btrfs/extent_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}

/*
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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));
Expand Down
10 changes: 5 additions & 5 deletions fs/btrfs/scrub.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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)) {
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 792e86e

Please sign in to comment.