return -EINVAL;
        }
 
-       ib_dev->ibd_bio_set = bioset_create(IBLOCK_BIO_POOL_SIZE, 0, BIOSET_NEED_BVECS);
-       if (!ib_dev->ibd_bio_set) {
+       ret = bioset_init(&ib_dev->ibd_bio_set, IBLOCK_BIO_POOL_SIZE, 0, BIOSET_NEED_BVECS);
+       if (ret) {
                pr_err("IBLOCK: Unable to create bioset\n");
                goto out;
        }
 
        bi = bdev_get_integrity(bd);
        if (bi) {
-               struct bio_set *bs = ib_dev->ibd_bio_set;
+               struct bio_set *bs = &ib_dev->ibd_bio_set;
 
                if (!strcmp(bi->profile->name, "T10-DIF-TYPE3-IP") ||
                    !strcmp(bi->profile->name, "T10-DIF-TYPE1-IP")) {
 out_blkdev_put:
        blkdev_put(ib_dev->ibd_bd, FMODE_WRITE|FMODE_READ|FMODE_EXCL);
 out_free_bioset:
-       bioset_free(ib_dev->ibd_bio_set);
-       ib_dev->ibd_bio_set = NULL;
+       bioset_exit(&ib_dev->ibd_bio_set);
 out:
        return ret;
 }
 
        if (ib_dev->ibd_bd != NULL)
                blkdev_put(ib_dev->ibd_bd, FMODE_WRITE|FMODE_READ|FMODE_EXCL);
-       if (ib_dev->ibd_bio_set != NULL)
-               bioset_free(ib_dev->ibd_bio_set);
+       bioset_exit(&ib_dev->ibd_bio_set);
 }
 
 static unsigned long long iblock_emulate_read_cap_with_block_size(
        if (sg_num > BIO_MAX_PAGES)
                sg_num = BIO_MAX_PAGES;
 
-       bio = bio_alloc_bioset(GFP_NOIO, sg_num, ib_dev->ibd_bio_set);
+       bio = bio_alloc_bioset(GFP_NOIO, sg_num, &ib_dev->ibd_bio_set);
        if (!bio) {
                pr_err("Unable to allocate memory for bio\n");
                return NULL;