diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2011-07-26 03:38:40 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2011-07-26 05:40:34 -0400 |
commit | 277c5f27a2c86a9a733c0ec0f6a9b1032dfa3e15 (patch) | |
tree | e2b09b9c0ffa657590981bc4d2af8908efa2f11d /drivers/target | |
parent | 36a26c69b4c70396ef569c3452690fba0c1dec08 (diff) |
target: Convert to DIV_ROUND_UP_SECTOR_T usage for sectors / dev_max_sectors
This patch adds the new macro usage of include/linux/kernel.h:DIV_ROUND_UP_SECTOR_T
for the new DIV_ROUND_UP_ULL() usage for 32-bit architectures with unsigned long long
sector_t division in transport_allocate_data_tasks() usage for target_core_mod v4.1
Reported-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r-- | drivers/target/target_core_transport.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 46352d658e35..c75a01a1c475 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c | |||
@@ -4052,17 +4052,16 @@ static int transport_allocate_data_tasks( | |||
4052 | struct se_task *task; | 4052 | struct se_task *task; |
4053 | struct se_device *dev = cmd->se_dev; | 4053 | struct se_device *dev = cmd->se_dev; |
4054 | unsigned long flags; | 4054 | unsigned long flags; |
4055 | sector_t sectors; | ||
4056 | int task_count, i, ret; | 4055 | int task_count, i, ret; |
4057 | sector_t dev_max_sectors = dev->se_sub_dev->se_dev_attrib.max_sectors; | 4056 | sector_t sectors, dev_max_sectors = dev->se_sub_dev->se_dev_attrib.max_sectors; |
4058 | u32 sector_size = dev->se_sub_dev->se_dev_attrib.block_size; | 4057 | u32 sector_size = dev->se_sub_dev->se_dev_attrib.block_size; |
4059 | struct scatterlist *sg; | 4058 | struct scatterlist *sg; |
4060 | struct scatterlist *cmd_sg; | 4059 | struct scatterlist *cmd_sg; |
4061 | 4060 | ||
4062 | WARN_ON(cmd->data_length % sector_size); | 4061 | WARN_ON(cmd->data_length % sector_size); |
4063 | sectors = DIV_ROUND_UP(cmd->data_length, sector_size); | 4062 | sectors = DIV_ROUND_UP(cmd->data_length, sector_size); |
4064 | task_count = DIV_ROUND_UP(sectors, dev_max_sectors); | 4063 | task_count = DIV_ROUND_UP_SECTOR_T(sectors, dev_max_sectors); |
4065 | 4064 | ||
4066 | cmd_sg = sgl; | 4065 | cmd_sg = sgl; |
4067 | for (i = 0; i < task_count; i++) { | 4066 | for (i = 0; i < task_count; i++) { |
4068 | unsigned int task_size; | 4067 | unsigned int task_size; |