Lines Matching defs:dr
994 dio_request_t *dr = kmem_zalloc(sizeof (dio_request_t) +
996 atomic_set(&dr->dr_ref, 0);
997 dr->dr_bio_count = bio_count;
998 dr->dr_error = 0;
1000 for (int i = 0; i < dr->dr_bio_count; i++)
1001 dr->dr_bio[i] = NULL;
1003 return (dr);
1007 vdev_classic_dio_free(dio_request_t *dr)
1011 for (i = 0; i < dr->dr_bio_count; i++)
1012 if (dr->dr_bio[i])
1013 bio_put(dr->dr_bio[i]);
1015 kmem_free(dr, sizeof (dio_request_t) +
1016 sizeof (struct bio *) * dr->dr_bio_count);
1020 vdev_classic_dio_get(dio_request_t *dr)
1022 atomic_inc(&dr->dr_ref);
1026 vdev_classic_dio_put(dio_request_t *dr)
1028 int rc = atomic_dec_return(&dr->dr_ref);
1035 zio_t *zio = dr->dr_zio;
1036 int error = dr->dr_error;
1038 vdev_classic_dio_free(dr);
1054 dio_request_t *dr = bio->bi_private;
1056 if (dr->dr_error == 0) {
1057 dr->dr_error = bi_status_to_errno(bio->bi_status);
1061 vdev_classic_dio_put(dr);
1088 dio_request_t *dr;
1110 dr = vdev_classic_dio_alloc(bio_count);
1118 dr->dr_zio = zio;
1134 for (int i = 0; i <= dr->dr_bio_count; i++) {
1144 if (dr->dr_bio_count == i) {
1145 vdev_classic_dio_free(dr);
1151 dr->dr_bio[i] = vdev_bio_alloc(bdev, GFP_NOIO, nr_vecs);
1152 if (unlikely(dr->dr_bio[i] == NULL)) {
1153 vdev_classic_dio_free(dr);
1158 vdev_classic_dio_get(dr);
1160 BIO_BI_SECTOR(dr->dr_bio[i]) = bio_offset >> 9;
1161 dr->dr_bio[i]->bi_end_io = vdev_classic_physio_completion;
1162 dr->dr_bio[i]->bi_private = dr;
1163 bio_set_op_attrs(dr->dr_bio[i], rw, flags);
1166 bio_size = abd_bio_map_off(dr->dr_bio[i], zio->io_abd,
1170 abd_offset += BIO_BI_SIZE(dr->dr_bio[i]);
1171 bio_offset += BIO_BI_SIZE(dr->dr_bio[i]);
1175 vdev_classic_dio_get(dr);
1177 if (dr->dr_bio_count > 1)
1181 for (int i = 0; i < dr->dr_bio_count; i++) {
1182 if (dr->dr_bio[i])
1183 vdev_submit_bio(dr->dr_bio[i]);
1186 if (dr->dr_bio_count > 1)
1189 vdev_classic_dio_put(dr);