diff options
Diffstat (limited to 'drivers/target/target_core_iblock.c')
-rw-r--r-- | drivers/target/target_core_iblock.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c index cc8e6b58ef20..8572eae62da7 100644 --- a/drivers/target/target_core_iblock.c +++ b/drivers/target/target_core_iblock.c | |||
@@ -129,7 +129,7 @@ static struct se_device *iblock_create_virtdevice( | |||
129 | /* | 129 | /* |
130 | * These settings need to be made tunable.. | 130 | * These settings need to be made tunable.. |
131 | */ | 131 | */ |
132 | ib_dev->ibd_bio_set = bioset_create(32, 64); | 132 | ib_dev->ibd_bio_set = bioset_create(32, 0); |
133 | if (!ib_dev->ibd_bio_set) { | 133 | if (!ib_dev->ibd_bio_set) { |
134 | pr_err("IBLOCK: Unable to create bioset()\n"); | 134 | pr_err("IBLOCK: Unable to create bioset()\n"); |
135 | return ERR_PTR(-ENOMEM); | 135 | return ERR_PTR(-ENOMEM); |
@@ -181,7 +181,7 @@ static struct se_device *iblock_create_virtdevice( | |||
181 | */ | 181 | */ |
182 | dev->se_sub_dev->se_dev_attrib.max_unmap_block_desc_count = 1; | 182 | dev->se_sub_dev->se_dev_attrib.max_unmap_block_desc_count = 1; |
183 | dev->se_sub_dev->se_dev_attrib.unmap_granularity = | 183 | dev->se_sub_dev->se_dev_attrib.unmap_granularity = |
184 | q->limits.discard_granularity; | 184 | q->limits.discard_granularity >> 9; |
185 | dev->se_sub_dev->se_dev_attrib.unmap_granularity_alignment = | 185 | dev->se_sub_dev->se_dev_attrib.unmap_granularity_alignment = |
186 | q->limits.discard_alignment; | 186 | q->limits.discard_alignment; |
187 | 187 | ||
@@ -488,6 +488,13 @@ iblock_get_bio(struct se_task *task, sector_t lba, u32 sg_num) | |||
488 | struct iblock_req *ib_req = IBLOCK_REQ(task); | 488 | struct iblock_req *ib_req = IBLOCK_REQ(task); |
489 | struct bio *bio; | 489 | struct bio *bio; |
490 | 490 | ||
491 | /* | ||
492 | * Only allocate as many vector entries as the bio code allows us to, | ||
493 | * we'll loop later on until we have handled the whole request. | ||
494 | */ | ||
495 | if (sg_num > BIO_MAX_PAGES) | ||
496 | sg_num = BIO_MAX_PAGES; | ||
497 | |||
491 | bio = bio_alloc_bioset(GFP_NOIO, sg_num, ib_dev->ibd_bio_set); | 498 | bio = bio_alloc_bioset(GFP_NOIO, sg_num, ib_dev->ibd_bio_set); |
492 | if (!bio) { | 499 | if (!bio) { |
493 | pr_err("Unable to allocate memory for bio\n"); | 500 | pr_err("Unable to allocate memory for bio\n"); |