mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-17 10:41:26 +00:00
Orig offset should also be saved during SG entries manipulations
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4744 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -2140,7 +2140,7 @@ struct scst_cmd {
|
||||
int *p_orig_sg_cnt;
|
||||
int orig_sg_cnt;
|
||||
struct scatterlist *orig_sg_entry;
|
||||
int orig_entry_len;
|
||||
int orig_entry_offs, orig_entry_len;
|
||||
|
||||
/* Used to retry commands in case of double UA */
|
||||
int dbl_ua_orig_resp_data_len, dbl_ua_orig_data_direction;
|
||||
|
||||
@@ -2816,6 +2816,7 @@ static void scst_adjust_sg(struct scst_cmd *cmd, struct scatterlist *sg,
|
||||
cmd->p_orig_sg_cnt = sg_cnt;
|
||||
cmd->orig_sg_cnt = *sg_cnt;
|
||||
cmd->orig_sg_entry = &sg[j];
|
||||
cmd->orig_entry_offs = sg[j].offset;
|
||||
cmd->orig_entry_len = sg[j].length;
|
||||
*sg_cnt = (left > 0) ? i+1 : i;
|
||||
sg[j].length = left;
|
||||
@@ -2835,10 +2836,11 @@ static void scst_adjust_sg(struct scst_cmd *cmd, struct scatterlist *sg,
|
||||
*/
|
||||
void scst_restore_sg_buff(struct scst_cmd *cmd)
|
||||
{
|
||||
TRACE_MEM("cmd %p, sg %p, orig_sg_entry %p, "
|
||||
TRACE_MEM("cmd %p, sg %p, orig_sg_entry %p, orig_entry_offs %d, "
|
||||
"orig_entry_len %d, orig_sg_cnt %d", cmd, cmd->sg,
|
||||
cmd->orig_sg_entry, cmd->orig_entry_len,
|
||||
cmd->orig_sg_entry, cmd->orig_entry_offs, cmd->orig_entry_len,
|
||||
cmd->orig_sg_cnt);
|
||||
cmd->orig_sg_entry->offset = cmd->orig_entry_offs;
|
||||
cmd->orig_sg_entry->length = cmd->orig_entry_len;
|
||||
*cmd->p_orig_sg_cnt = cmd->orig_sg_cnt;
|
||||
cmd->sg_buff_modified = 0;
|
||||
|
||||
Reference in New Issue
Block a user