Skip to content

Commit 9f7c3f8

Browse files
Christoph Hellwigliu-song-6
authored andcommitted
raid5-ppl: fully initialize the bio in ppl_new_iounit
We have all the information to pass the bdev and op directly to bio_init, so do that. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Song Liu <song@kernel.org>
1 parent a2daeab commit 9f7c3f8

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

drivers/md/raid5-ppl.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,8 @@ static struct ppl_io_unit *ppl_new_iounit(struct ppl_log *log,
250250
INIT_LIST_HEAD(&io->stripe_list);
251251
atomic_set(&io->pending_stripes, 0);
252252
atomic_set(&io->pending_flushes, 0);
253-
bio_init(&io->bio, NULL, io->biovec, PPL_IO_INLINE_BVECS, 0);
253+
bio_init(&io->bio, log->rdev->bdev, io->biovec, PPL_IO_INLINE_BVECS,
254+
REQ_OP_WRITE | REQ_FUA);
254255

255256
pplhdr = page_address(io->header_page);
256257
clear_page(pplhdr);
@@ -465,8 +466,6 @@ static void ppl_submit_iounit(struct ppl_io_unit *io)
465466

466467

467468
bio->bi_end_io = ppl_log_endio;
468-
bio->bi_opf = REQ_OP_WRITE | REQ_FUA;
469-
bio_set_dev(bio, log->rdev->bdev);
470469
bio->bi_iter.bi_sector = log->next_io_sector;
471470
bio_add_page(bio, io->header_page, PAGE_SIZE, 0);
472471
bio->bi_write_hint = ppl_conf->write_hint;

0 commit comments

Comments
 (0)