diff options
Diffstat (limited to 'module')
-rw-r--r-- | module/os/linux/zfs/vdev_disk.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/module/os/linux/zfs/vdev_disk.c b/module/os/linux/zfs/vdev_disk.c index 08c333134..aaaf41059 100644 --- a/module/os/linux/zfs/vdev_disk.c +++ b/module/os/linux/zfs/vdev_disk.c @@ -593,9 +593,14 @@ retry: } /* bio_alloc() with __GFP_WAIT never returns NULL */ +#ifdef HAVE_BIO_MAX_SEGS + dr->dr_bio[i] = bio_alloc(GFP_NOIO, bio_max_segs( + abd_nr_pages_off(zio->io_abd, bio_size, abd_offset))); +#else dr->dr_bio[i] = bio_alloc(GFP_NOIO, MIN(abd_nr_pages_off(zio->io_abd, bio_size, abd_offset), BIO_MAX_PAGES)); +#endif if (unlikely(dr->dr_bio[i] == NULL)) { vdev_disk_dio_free(dr); return (SET_ERROR(ENOMEM)); |