Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 208261
b: refs/heads/master
c: 610a634
h: refs/heads/master
i:
  208259: cd1702e
v: v3
  • Loading branch information
FUJITA Tomonori authored and Jens Axboe committed Aug 7, 2010
1 parent 200b1b2 commit 6c7b909
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 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: 9e094383b60066996fbc3b53891324e5d2ec858d
refs/heads/master: 610a63498f7f366031a6327eaaa9963ffa110b2b
7 changes: 2 additions & 5 deletions trunk/drivers/scsi/scsi_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1011,11 +1011,8 @@ int scsi_init_io(struct scsi_cmnd *cmd, gfp_t gfp_mask)

err_exit:
scsi_release_buffers(cmd);
if (error == BLKPREP_KILL)
scsi_put_command(cmd);
else /* BLKPREP_DEFER */
scsi_unprep_request(cmd->request);

scsi_put_command(cmd);
cmd->request->special = NULL;
return error;
}
EXPORT_SYMBOL(scsi_init_io);
Expand Down
10 changes: 8 additions & 2 deletions trunk/drivers/scsi/sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,10 @@ static int scsi_setup_discard_cmnd(struct scsi_device *sdp, struct request *rq)
blk_add_request_payload(rq, page, len);
ret = scsi_setup_blk_pc_cmnd(sdp, rq);
rq->buffer = page_address(page);
if (ret != BLKPREP_OK) {
__free_page(page);
rq->buffer = NULL;
}
return ret;
}

Expand All @@ -485,8 +489,10 @@ static int scsi_setup_flush_cmnd(struct scsi_device *sdp, struct request *rq)

static void sd_unprep_fn(struct request_queue *q, struct request *rq)
{
if (rq->cmd_flags & REQ_DISCARD)
__free_page(virt_to_page(rq->buffer));
if (rq->cmd_flags & REQ_DISCARD) {
free_page((unsigned long)rq->buffer);
rq->buffer = NULL;
}
}

/**
Expand Down

0 comments on commit 6c7b909

Please sign in to comment.