|
@@ -1103,51 +1103,6 @@ int se_dev_set_queue_depth(struct se_device *dev, u32 queue_depth)
|
|
}
|
|
}
|
|
EXPORT_SYMBOL(se_dev_set_queue_depth);
|
|
EXPORT_SYMBOL(se_dev_set_queue_depth);
|
|
|
|
|
|
-int se_dev_set_fabric_max_sectors(struct se_device *dev, u32 fabric_max_sectors)
|
|
|
|
-{
|
|
|
|
- int block_size = dev->dev_attrib.block_size;
|
|
|
|
-
|
|
|
|
- if (dev->export_count) {
|
|
|
|
- pr_err("dev[%p]: Unable to change SE Device"
|
|
|
|
- " fabric_max_sectors while export_count is %d\n",
|
|
|
|
- dev, dev->export_count);
|
|
|
|
- return -EINVAL;
|
|
|
|
- }
|
|
|
|
- if (!fabric_max_sectors) {
|
|
|
|
- pr_err("dev[%p]: Illegal ZERO value for"
|
|
|
|
- " fabric_max_sectors\n", dev);
|
|
|
|
- return -EINVAL;
|
|
|
|
- }
|
|
|
|
- if (fabric_max_sectors < DA_STATUS_MAX_SECTORS_MIN) {
|
|
|
|
- pr_err("dev[%p]: Passed fabric_max_sectors: %u less than"
|
|
|
|
- " DA_STATUS_MAX_SECTORS_MIN: %u\n", dev, fabric_max_sectors,
|
|
|
|
- DA_STATUS_MAX_SECTORS_MIN);
|
|
|
|
- return -EINVAL;
|
|
|
|
- }
|
|
|
|
- if (fabric_max_sectors > DA_STATUS_MAX_SECTORS_MAX) {
|
|
|
|
- pr_err("dev[%p]: Passed fabric_max_sectors: %u"
|
|
|
|
- " greater than DA_STATUS_MAX_SECTORS_MAX:"
|
|
|
|
- " %u\n", dev, fabric_max_sectors,
|
|
|
|
- DA_STATUS_MAX_SECTORS_MAX);
|
|
|
|
- return -EINVAL;
|
|
|
|
- }
|
|
|
|
- /*
|
|
|
|
- * Align max_sectors down to PAGE_SIZE to follow transport_allocate_data_tasks()
|
|
|
|
- */
|
|
|
|
- if (!block_size) {
|
|
|
|
- block_size = 512;
|
|
|
|
- pr_warn("Defaulting to 512 for zero block_size\n");
|
|
|
|
- }
|
|
|
|
- fabric_max_sectors = se_dev_align_max_sectors(fabric_max_sectors,
|
|
|
|
- block_size);
|
|
|
|
-
|
|
|
|
- dev->dev_attrib.fabric_max_sectors = fabric_max_sectors;
|
|
|
|
- pr_debug("dev[%p]: SE Device max_sectors changed to %u\n",
|
|
|
|
- dev, fabric_max_sectors);
|
|
|
|
- return 0;
|
|
|
|
-}
|
|
|
|
-EXPORT_SYMBOL(se_dev_set_fabric_max_sectors);
|
|
|
|
-
|
|
|
|
int se_dev_set_optimal_sectors(struct se_device *dev, u32 optimal_sectors)
|
|
int se_dev_set_optimal_sectors(struct se_device *dev, u32 optimal_sectors)
|
|
{
|
|
{
|
|
if (dev->export_count) {
|
|
if (dev->export_count) {
|
|
@@ -1553,7 +1508,6 @@ struct se_device *target_alloc_device(struct se_hba *hba, const char *name)
|
|
dev->dev_attrib.unmap_granularity_alignment =
|
|
dev->dev_attrib.unmap_granularity_alignment =
|
|
DA_UNMAP_GRANULARITY_ALIGNMENT_DEFAULT;
|
|
DA_UNMAP_GRANULARITY_ALIGNMENT_DEFAULT;
|
|
dev->dev_attrib.max_write_same_len = DA_MAX_WRITE_SAME_LEN;
|
|
dev->dev_attrib.max_write_same_len = DA_MAX_WRITE_SAME_LEN;
|
|
- dev->dev_attrib.fabric_max_sectors = DA_FABRIC_MAX_SECTORS;
|
|
|
|
|
|
|
|
xcopy_lun = &dev->xcopy_lun;
|
|
xcopy_lun = &dev->xcopy_lun;
|
|
xcopy_lun->lun_se_dev = dev;
|
|
xcopy_lun->lun_se_dev = dev;
|