@@ -272,9 +272,8 @@ static int nd_blk_probe(struct device *dev)
}
blk_queue_make_request(blk_dev->queue, nd_blk_make_request);
- blk_queue_max_hw_sectors(blk_dev->queue, 1024);
- blk_queue_bounce_limit(blk_dev->queue, BLK_BOUNCE_ANY);
blk_queue_logical_block_size(blk_dev->queue, blk_dev->sector_size);
+ nd_blk_queue_init(blk_dev->queue);
disk = blk_dev->disk = alloc_disk(0);
if (!disk) {
@@ -1285,9 +1285,8 @@ static int btt_blk_init(struct btt *btt)
btt->btt_disk->flags = GENHD_FL_EXT_DEVT;
blk_queue_make_request(btt->btt_queue, btt_make_request);
- blk_queue_max_hw_sectors(btt->btt_queue, 1024);
- blk_queue_bounce_limit(btt->btt_queue, BLK_BOUNCE_ANY);
blk_queue_logical_block_size(btt->btt_queue, btt->sector_size);
+ nd_blk_queue_init(btt->btt_queue);
btt->btt_queue->queuedata = btt;
set_capacity(btt->btt_disk, 0);
@@ -214,6 +214,13 @@ ssize_t nd_sector_size_store(struct device *dev, const char *buf,
}
}
+void nd_blk_queue_init(struct request_queue *q)
+{
+ blk_queue_max_hw_sectors(q, UINT_MAX);
+ blk_queue_bounce_limit(q, BLK_BOUNCE_ANY);
+}
+EXPORT_SYMBOL(nd_blk_queue_init);
+
static ssize_t commands_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
@@ -171,5 +171,6 @@ struct resource *nvdimm_allocate_dpa(struct nvdimm_drvdata *ndd,
struct nd_label_id *label_id, resource_size_t start,
resource_size_t n);
int nd_blk_region_init(struct nd_region *nd_region);
+void nd_blk_queue_init(struct request_queue *q);
resource_size_t nd_namespace_blk_validate(struct nd_namespace_blk *nsblk);
#endif /* __ND_H__ */
@@ -172,8 +172,7 @@ static struct pmem_device *pmem_alloc(struct device *dev,
goto out_unmap;
blk_queue_make_request(pmem->pmem_queue, pmem_make_request);
- blk_queue_max_hw_sectors(pmem->pmem_queue, 1024);
- blk_queue_bounce_limit(pmem->pmem_queue, BLK_BOUNCE_ANY);
+ nd_blk_queue_init(pmem->pmem_queue);
disk = alloc_disk(0);
if (!disk)