Lines Matching defs:bio

79  * Maximum number of segments to add to a bio (min 4). If this is higher than
542 * request queue's root_blkg to the bio.
545 vdev_bio_associate_blkg(struct bio *bio)
548 struct request_queue *q = bio->bi_bdev->bd_disk->queue;
550 struct request_queue *q = bio->bi_disk->queue;
554 ASSERT3P(bio->bi_blkg, ==, NULL);
557 bio->bi_blkg = q->root_blkg;
563 vdev_bio_set_dev(struct bio *bio, struct block_device *bdev)
568 struct request_queue *q = bio->bi_disk->queue;
570 bio_clear_flag(bio, BIO_REMAPPED);
571 if (bio->bi_bdev != bdev)
572 bio_clear_flag(bio, BIO_THROTTLED);
573 bio->bi_bdev = bdev;
576 ASSERT3P(bio->bi_blkg, ==, NULL);
579 bio->bi_blkg = q->root_blkg;
587 vdev_submit_bio(struct bio *bio)
591 (void) submit_bio(bio);
595 static inline struct bio *
599 struct bio *bio;
602 bio = bio_alloc(bdev, nr_vecs, 0, gfp_mask);
604 bio = bio_alloc(gfp_mask, nr_vecs);
605 if (likely(bio != NULL))
606 bio_set_dev(bio, bdev);
609 return (bio);
660 uint_t vbio_max_segs; /* max segs per bio */
662 uint_t vbio_max_bytes; /* max bytes per bio */
665 uint64_t vbio_offset; /* start offset of next bio */
667 struct bio *vbio_bio; /* pointer to the current bio */
668 int vbio_flags; /* bio flags */
689 static void vbio_completion(struct bio *bio);
694 struct bio *bio = vbio->vbio_bio;
698 if (bio == NULL) {
700 bio = vdev_bio_alloc(vbio->vbio_bdev, GFP_NOIO,
702 VERIFY(bio);
704 BIO_BI_SECTOR(bio) = vbio->vbio_offset >> 9;
705 bio_set_op_attrs(bio,
710 bio_chain(vbio->vbio_bio, bio);
713 vbio->vbio_bio = bio;
724 ssize = MIN(size, (vbio->vbio_max_bytes - BIO_BI_SIZE(bio)) &
727 bio_add_page(bio, page, ssize, offset) == ssize) {
735 vbio->vbio_offset += BIO_BI_SIZE(bio);
738 bio = NULL;
775 * can't touch it again. The bio may complete and vbio_completion() be
786 vbio_completion(struct bio *bio)
788 vbio_t *vbio = bio->bi_private;
794 zio->io_error = bi_status_to_errno(bio->bi_status);
801 bio_put(bio);
987 int dr_bio_count; /* Count of bio's */
988 struct bio *dr_bio[]; /* Attached bio's */
995 sizeof (struct bio *) * bio_count, KM_SLEEP);
1016 sizeof (struct bio *) * dr->dr_bio_count);
1052 vdev_classic_physio_completion(struct bio *bio)
1054 dio_request_t *dr = bio->bi_private;
1057 dr->dr_error = bi_status_to_errno(bio->bi_status);
1121 * Since bio's can have up to BIO_MAX_PAGES=256 iovec's, each of which
1122 * is at least 512 bytes and at most PAGESIZE (typically 4K), one bio
1125 * bio's and wait for them all to complete. This is likely if the
1136 /* Finished constructing bio's for given buffer */
1141 * If additional bio's are required, we have to retry, but
1169 /* Advance in buffer and construct another bio if needed */
1180 /* Submit all bio's associated with this dio */
1197 vdev_disk_io_flush_completion(struct bio *bio)
1199 zio_t *zio = bio->bi_private;
1200 zio->io_error = bi_status_to_errno(bio->bi_status);
1204 bio_put(bio);
1215 struct bio *bio;
1221 bio = vdev_bio_alloc(bdev, GFP_NOIO, 0);
1222 if (unlikely(bio == NULL))
1225 bio->bi_end_io = vdev_disk_io_flush_completion;
1226 bio->bi_private = zio;
1227 bio_set_flush(bio);
1228 vdev_submit_bio(bio);
1235 vdev_disk_discard_end_io(struct bio *bio)
1237 zio_t *zio = bio->bi_private;
1238 zio->io_error = bi_status_to_errno(bio->bi_status);
1240 bio_put(bio);
1248 * when available; in this case, *biop is set to the last bio in the chain.
1252 sector_t nsect, struct bio **biop)
1275 sector_t nsect, struct bio **biop)
1308 struct bio *bio;
1315 error = vdev_bdev_issue_secure_erase(bdh, sector, nsects, &bio);
1317 error = vdev_bdev_issue_discard(bdh, sector, nsects, &bio);
1322 if (bio == NULL) {
1333 bio->bi_private = zio;
1334 bio->bi_end_io = vdev_disk_discard_end_io;
1335 vdev_submit_bio(bio);