mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-18 11:11:27 +00:00
Micro-optimization: cmd_data_descriptors_cnt isn't needed
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4308 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -2116,13 +2116,11 @@ struct scst_cmd {
|
||||
|
||||
/*
|
||||
* List of parsed data descriptors for commands operating with
|
||||
* several lba and data_len pairs, like UNMAP.
|
||||
* several lba and data_len pairs, like UNMAP, finished with zero
|
||||
* length entry.
|
||||
*/
|
||||
void *cmd_data_descriptors;
|
||||
|
||||
/* Count of entries in the descriptors array */
|
||||
int cmd_data_descriptors_cnt;
|
||||
|
||||
#ifdef CONFIG_SCST_MEASURE_LATENCY
|
||||
/*
|
||||
* Must be the last to allow to work with drivers who don't know
|
||||
|
||||
@@ -2034,8 +2034,7 @@ static enum compl_status_e vdisk_exec_unmap(struct vdisk_cmd_params *p)
|
||||
if (pd == NULL)
|
||||
goto out;
|
||||
|
||||
for (i = 0; i < cmd->cmd_data_descriptors_cnt; i++) {
|
||||
struct scst_data_descriptor *d;
|
||||
for (i = 0; pd[i].sdd_len != 0; i++) {
|
||||
int rc;
|
||||
|
||||
if (unlikely(test_bit(SCST_CMD_ABORTED, &cmd->cmd_flags))) {
|
||||
@@ -2043,8 +2042,7 @@ static enum compl_status_e vdisk_exec_unmap(struct vdisk_cmd_params *p)
|
||||
goto out;
|
||||
}
|
||||
|
||||
d = &pd[i];
|
||||
rc = vdisk_unmap_range(cmd, virt_dev, d->sdd_lba, d->sdd_len);
|
||||
rc = vdisk_unmap_range(cmd, virt_dev, pd[i].sdd_lba, pd[i].sdd_len);
|
||||
if (rc != 0)
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -8217,7 +8217,6 @@ static bool scst_parse_unmap_descriptors(struct scst_cmd *cmd)
|
||||
}
|
||||
|
||||
cmd->cmd_data_descriptors = pd;
|
||||
cmd->cmd_data_descriptors_cnt = cnt;
|
||||
|
||||
out_put:
|
||||
scst_put_buf_full(cmd, address);
|
||||
|
||||
Reference in New Issue
Block a user