Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147044
b: refs/heads/master
c: 5f49f63
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo authored and Jens Axboe committed May 19, 2009
1 parent 28aaa5f commit 701dd73
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 14 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: 3755100dd5f66761aaaa7ae44c70b319a7c78a56
refs/heads/master: 5f49f63178360b07a095bd33b0d850d60edf7590
5 changes: 3 additions & 2 deletions trunk/block/blk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1783,9 +1783,10 @@ void blk_start_request(struct request *req)
blk_dequeue_request(req);

/*
* We are now handing the request to the hardware, add the
* timeout handler.
* We are now handing the request to the hardware, initialize
* resid_len to full count and add the timeout handler.
*/
req->resid_len = blk_rq_bytes(req);
blk_add_timer(req);
}
EXPORT_SYMBOL(blk_start_request);
Expand Down
6 changes: 4 additions & 2 deletions trunk/drivers/block/ub.c
Original file line number Diff line number Diff line change
Expand Up @@ -781,8 +781,10 @@ static void ub_rw_cmd_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd)

if (cmd->error == 0) {
if (blk_pc_request(rq)) {
if (cmd->act_len < blk_rq_bytes(rq))
rq->resid_len = blk_rq_bytes(rq) - cmd->act_len;
if (cmd->act_len >= rq->resid_len)
rq->resid_len = 0;
else
rq->resid_len -= cmd->act_len;
scsi_status = 0;
} else {
if (cmd->act_len != cmd->len) {
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/ide/ide-cd.c
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,7 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)

out_end:
if (blk_pc_request(rq) && rc == 0) {
rq->resid_len = 0;
blk_end_request_all(rq, 0);
hwif->rq = NULL;
} else {
Expand All @@ -718,8 +719,7 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)

/* make sure it's fully ended */
if (blk_fs_request(rq) == 0) {
rq->resid_len = blk_rq_bytes(rq) -
(cmd->nbytes - cmd->nleft);
rq->resid_len -= cmd->nbytes - cmd->nleft;
if (uptodate == 0 && (cmd->tf_flags & IDE_TFLAG_WRITE))
rq->resid_len += cmd->last_xfer_len;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/ide/ide-tape.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ static int ide_tape_callback(ide_drive_t *drive, int dsc)
}

tape->first_frame += blocks;
rq->resid_len = blk_rq_bytes(rq) - blocks * tape->blk_size;
rq->resid_len -= blocks * tape->blk_size;

if (pc->error) {
uptodate = 0;
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/message/fusion/mptsas.c
Original file line number Diff line number Diff line change
Expand Up @@ -1357,7 +1357,8 @@ static int mptsas_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy,
smprep = (SmpPassthroughReply_t *)ioc->sas_mgmt.reply;
memcpy(req->sense, smprep, sizeof(*smprep));
req->sense_len = sizeof(*smprep);
rsp->resid_len = blk_rq_bytes(rsp) - smprep->ResponseDataLength;
req->resid_len = 0;
rsp->resid_len -= smprep->ResponseDataLength;
} else {
printk(MYIOC_s_ERR_FMT "%s: smp passthru reply failed to be returned\n",
ioc->name, __func__);
Expand Down
4 changes: 4 additions & 0 deletions trunk/drivers/scsi/libsas/sas_expander.c
Original file line number Diff line number Diff line change
Expand Up @@ -1937,7 +1937,11 @@ int sas_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy,
if (ret > 0) {
/* positive number is the untransferred residual */
rsp->resid_len = ret;
req->resid_len = 0;
ret = 0;
} else if (ret == 0) {
rsp->resid_len = 0;
req->resid_len = 0;
}

return ret;
Expand Down
3 changes: 0 additions & 3 deletions trunk/drivers/scsi/libsas/sas_host_smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,6 @@ int sas_smp_host_handler(struct Scsi_Host *shost, struct request *req,
resp_data[1] = req_data[1];
resp_data[2] = SMP_RESP_FUNC_UNK;

req->resid_len = blk_rq_bytes(req);
rsp->resid_len = blk_rq_bytes(rsp);

switch (req_data[1]) {
case SMP_REPORT_GENERAL:
req->resid_len -= 8;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/scsi/mpt2sas/mpt2sas_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -1170,8 +1170,8 @@ transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy,

memcpy(req->sense, mpi_reply, sizeof(*mpi_reply));
req->sense_len = sizeof(*mpi_reply);
rsp->resid_len = blk_rq_bytes(rsp) -
mpi_reply->ResponseDataLength;
req->resid_len = 0;
rsp->resid_len -= mpi_reply->ResponseDataLength;
} else {
dtransportprintk(ioc, printk(MPT2SAS_DEBUG_FMT
"%s - no reply\n", ioc->name, __func__));
Expand Down

0 comments on commit 701dd73

Please sign in to comment.