Skip to content

Commit

Permalink
[SCSI] bidirectional: fix up for the new blk_end_request code
Browse files Browse the repository at this point in the history
Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
  • Loading branch information
Kiyoshi Ueda authored and James Bottomley committed Jan 30, 2008
1 parent 6f9a35e commit b8de163
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions drivers/scsi/scsi_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -812,8 +812,16 @@ EXPORT_SYMBOL(scsi_release_buffers);
*/
void scsi_end_bidi_request(struct scsi_cmnd *cmd)
{
blk_end_bidi_request(cmd->request, 0, scsi_out(cmd)->resid,
scsi_in(cmd)->resid);
struct request *req = cmd->request;
unsigned int dlen = req->data_len;
unsigned int next_dlen = req->next_rq->data_len;

req->data_len = scsi_out(cmd)->resid;
req->next_rq->data_len = scsi_in(cmd)->resid;

/* The req and req->next_rq have not been completed */
BUG_ON(blk_end_bidi_request(req, 0, dlen, next_dlen));

scsi_release_buffers(cmd);

/*
Expand Down

0 comments on commit b8de163

Please sign in to comment.