diff options
Diffstat (limited to 'module/zfs/vdev_disk.c')
-rw-r--r-- | module/zfs/vdev_disk.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/module/zfs/vdev_disk.c b/module/zfs/vdev_disk.c index c6bb24a33..87cc2c892 100644 --- a/module/zfs/vdev_disk.c +++ b/module/zfs/vdev_disk.c @@ -503,6 +503,14 @@ vdev_submit_bio_impl(struct bio *bio) #endif } +#ifndef HAVE_BIO_SET_DEV +static inline void +bio_set_dev(struct bio *bio, struct block_device *bdev) +{ + bio->bi_bdev = bdev; +} +#endif /* !HAVE_BIO_SET_DEV */ + static inline void vdev_submit_bio(struct bio *bio) { @@ -585,7 +593,7 @@ retry: /* Matching put called by vdev_disk_physio_completion */ vdev_disk_dio_get(dr); - dr->dr_bio[i]->bi_bdev = bdev; + bio_set_dev(dr->dr_bio[i], bdev); BIO_BI_SECTOR(dr->dr_bio[i]) = bio_offset >> 9; dr->dr_bio[i]->bi_end_io = vdev_disk_physio_completion; dr->dr_bio[i]->bi_private = dr; @@ -659,7 +667,7 @@ vdev_disk_io_flush(struct block_device *bdev, zio_t *zio) bio->bi_end_io = vdev_disk_io_flush_completion; bio->bi_private = zio; - bio->bi_bdev = bdev; + bio_set_dev(bio, bdev); bio_set_flush(bio); vdev_submit_bio(bio); invalidate_bdev(bdev); |