aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2014-06-06 09:57:37 -0400
committerJens Axboe <axboe@fb.com>2014-06-06 09:57:37 -0400
commitf27b087b81b70513b8c61ec20596c868f7b93474 (patch)
tree5dbdf3552f2289c28e65b0fee4490803bff87d42 /drivers/target
parent762380ad9322951cea4ce9d24864265f9c66a916 (diff)
block: add blk_rq_set_block_pc()
With the optimizations around not clearing the full request at alloc time, we are leaving some of the needed init for REQ_TYPE_BLOCK_PC up to the user allocating the request. Add a blk_rq_set_block_pc() that sets the command type to REQ_TYPE_BLOCK_PC, and properly initializes the members associated with this type of request. Update callers to use this function instead of manipulating rq->cmd_type directly. Includes fixes from Christoph Hellwig <hch@lst.de> for my half-assed attempt. Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/target')
-rw-r--r--drivers/target/target_core_pscsi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c
index 0f199f6a0738..94d00df28f39 100644
--- a/drivers/target/target_core_pscsi.c
+++ b/drivers/target/target_core_pscsi.c
@@ -1055,6 +1055,8 @@ pscsi_execute_cmd(struct se_cmd *cmd)
1055 ret = TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; 1055 ret = TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
1056 goto fail; 1056 goto fail;
1057 } 1057 }
1058
1059 blk_rq_set_block_pc(req);
1058 } else { 1060 } else {
1059 BUG_ON(!cmd->data_length); 1061 BUG_ON(!cmd->data_length);
1060 1062
@@ -1071,7 +1073,6 @@ pscsi_execute_cmd(struct se_cmd *cmd)
1071 } 1073 }
1072 } 1074 }
1073 1075
1074 req->cmd_type = REQ_TYPE_BLOCK_PC;
1075 req->end_io = pscsi_req_done; 1076 req->end_io = pscsi_req_done;
1076 req->end_io_data = cmd; 1077 req->end_io_data = cmd;
1077 req->cmd_len = scsi_command_size(pt->pscsi_cdb); 1078 req->cmd_len = scsi_command_size(pt->pscsi_cdb);