Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 95782
b: refs/heads/master
c: 2c51ae7
h: refs/heads/master
v: v3
  • Loading branch information
Pete Zaitcev authored and Greg Kroah-Hartman committed May 2, 2008
1 parent 1fe033a commit fbf6f57
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 043042109b24a1bd418db7cd509dadc5d120daf1
refs/heads/master: 2c51ae70ede5a90d8ccb67d965c1b4e20fc4e110
17 changes: 15 additions & 2 deletions trunk/drivers/block/ub.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ struct ub_scsi_cmd {
unsigned char key, asc, ascq; /* May be valid if error==-EIO */

int stat_count; /* Retries getting status. */
unsigned int timeo; /* jiffies until rq->timeout changes */

unsigned int len; /* Requested length */
unsigned int current_sg;
Expand Down Expand Up @@ -764,6 +765,12 @@ static void ub_cmd_build_packet(struct ub_dev *sc, struct ub_lun *lun,
cmd->cdb_len = rq->cmd_len;

cmd->len = rq->data_len;

/*
* To reapply this to every URB is not as incorrect as it looks.
* In return, we avoid any complicated tracking calculations.
*/
cmd->timeo = rq->timeout;
}

static void ub_rw_cmd_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
Expand Down Expand Up @@ -1336,7 +1343,10 @@ static void ub_data_start(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
return;
}

sc->work_timer.expires = jiffies + UB_DATA_TIMEOUT;
if (cmd->timeo)
sc->work_timer.expires = jiffies + cmd->timeo;
else
sc->work_timer.expires = jiffies + UB_DATA_TIMEOUT;
add_timer(&sc->work_timer);

cmd->state = UB_CMDST_DATA;
Expand Down Expand Up @@ -1376,7 +1386,10 @@ static int __ub_state_stat(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
return -1;
}

sc->work_timer.expires = jiffies + UB_STAT_TIMEOUT;
if (cmd->timeo)
sc->work_timer.expires = jiffies + cmd->timeo;
else
sc->work_timer.expires = jiffies + UB_STAT_TIMEOUT;
add_timer(&sc->work_timer);
return 0;
}
Expand Down

0 comments on commit fbf6f57

Please sign in to comment.