diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2012-05-09 12:42:09 -0700 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2012-05-09 15:08:47 -0700 |
commit | 11e764bd5ed4bb930e0ec5dd161df58307507347 (patch) | |
tree | fa753a950d19c2ef848c50c60f71019dcb912e74 /drivers/target/target_core_transport.c | |
parent | 2301917044b96fda41f794011368e623a9b7a435 (diff) | |
download | linux-11e764bd5ed4bb930e0ec5dd161df58307507347.tar.gz linux-11e764bd5ed4bb930e0ec5dd161df58307507347.tar.xz linux-11e764bd5ed4bb930e0ec5dd161df58307507347.zip |
target: Remove max_sectors device attribute for modern se_task less code
This patch removes the original usage of dev_attr->max_sectors in favor of
dev_attr->hw_max_sectors that is now being enforced by target core from
within transport_generic_cmd_sequencer() for SCF_SCSI_DATA_SG_IO_CDB ops.
After the recent se_task removal patches from hch, this value for IBLOCK
backends being set via configfs by userspace from an saved max_sectors
value that is turning out to be problematic, so it makes sense to go ahead
and remove this now legacy attribute all-together.
This patch also continues to make se_dev_set_default_attribs() do
(sectors / block_size) alignment for what actually get used by
target_core_mod to be safe here, following the same alignment currently
used by fabric_max_sectors.
Reported-by: Andy Grover <agrover@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Roland Dreier <roland@purestorage.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/target_core_transport.c')
-rw-r--r-- | drivers/target/target_core_transport.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 85f14e0fe5d3..59577568f935 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -870,8 +870,9 @@ void transport_dump_dev_state( *bl += sprintf(b + *bl, " Execute/Max Queue Depth: %d/%d", atomic_read(&dev->execute_tasks), dev->queue_depth); - *bl += sprintf(b + *bl, " SectorSize: %u MaxSectors: %u\n", - dev->se_sub_dev->se_dev_attrib.block_size, dev->se_sub_dev->se_dev_attrib.max_sectors); + *bl += sprintf(b + *bl, " SectorSize: %u HwMaxSectors: %u\n", + dev->se_sub_dev->se_dev_attrib.block_size, + dev->se_sub_dev->se_dev_attrib.hw_max_sectors); *bl += sprintf(b + *bl, " "); } @@ -3498,7 +3499,7 @@ int transport_generic_new_cmd(struct se_cmd *cmd) BUG_ON(cmd->data_length % attr->block_size); BUG_ON(DIV_ROUND_UP(cmd->data_length, attr->block_size) > - attr->max_sectors); + attr->hw_max_sectors); } atomic_inc(&cmd->t_fe_count); |