aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/scsi_lib.c22
-rw-r--r--drivers/scsi/sd.c2
-rw-r--r--drivers/scsi/sr.c3
3 files changed, 14 insertions, 13 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 150d7bb675a1..2afb96b801cb 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1082,11 +1082,10 @@ int scsi_setup_blk_pc_cmnd(struct scsi_device *sdev, struct request *req)
1082EXPORT_SYMBOL(scsi_setup_blk_pc_cmnd); 1082EXPORT_SYMBOL(scsi_setup_blk_pc_cmnd);
1083 1083
1084/* 1084/*
1085 * Setup a REQ_TYPE_FS command. These are simple read/write request 1085 * Setup a REQ_TYPE_FS command. These are simple request from filesystems
1086 * from filesystems that still need to be translated to SCSI CDBs from 1086 * that still need to be translated to SCSI CDBs from the ULD.
1087 * the ULD.
1088 */ 1087 */
1089int scsi_setup_fs_cmnd(struct scsi_device *sdev, struct request *req) 1088static int scsi_setup_fs_cmnd(struct scsi_device *sdev, struct request *req)
1090{ 1089{
1091 struct scsi_cmnd *cmd = req->special; 1090 struct scsi_cmnd *cmd = req->special;
1092 1091
@@ -1098,9 +1097,8 @@ int scsi_setup_fs_cmnd(struct scsi_device *sdev, struct request *req)
1098 } 1097 }
1099 1098
1100 memset(cmd->cmnd, 0, BLK_MAX_CDB); 1099 memset(cmd->cmnd, 0, BLK_MAX_CDB);
1101 return scsi_init_io(cmd, GFP_ATOMIC); 1100 return scsi_cmd_to_driver(cmd)->init_command(cmd);
1102} 1101}
1103EXPORT_SYMBOL(scsi_setup_fs_cmnd);
1104 1102
1105static int 1103static int
1106scsi_prep_state_check(struct scsi_device *sdev, struct request *req) 1104scsi_prep_state_check(struct scsi_device *sdev, struct request *req)
@@ -1205,12 +1203,16 @@ static int scsi_prep_fn(struct request_queue *q, struct request *req)
1205 goto out; 1203 goto out;
1206 } 1204 }
1207 1205
1208 if (req->cmd_type == REQ_TYPE_FS) 1206 switch (req->cmd_type) {
1209 ret = scsi_cmd_to_driver(cmd)->init_command(cmd); 1207 case REQ_TYPE_FS:
1210 else if (req->cmd_type == REQ_TYPE_BLOCK_PC) 1208 ret = scsi_setup_fs_cmnd(sdev, req);
1209 break;
1210 case REQ_TYPE_BLOCK_PC:
1211 ret = scsi_setup_blk_pc_cmnd(sdev, req); 1211 ret = scsi_setup_blk_pc_cmnd(sdev, req);
1212 else 1212 break;
1213 default:
1213 ret = BLKPREP_KILL; 1214 ret = BLKPREP_KILL;
1215 }
1214 1216
1215out: 1217out:
1216 return scsi_prep_return(q, req, ret); 1218 return scsi_prep_return(q, req, ret);
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 87566b51fcf7..1b166c7ea891 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -894,7 +894,7 @@ static int sd_init_command(struct scsi_cmnd *SCpnt)
894 ret = scsi_setup_flush_cmnd(sdp, rq); 894 ret = scsi_setup_flush_cmnd(sdp, rq);
895 goto out; 895 goto out;
896 } 896 }
897 ret = scsi_setup_fs_cmnd(sdp, rq); 897 ret = scsi_init_io(SCpnt, GFP_ATOMIC);
898 if (ret != BLKPREP_OK) 898 if (ret != BLKPREP_OK)
899 goto out; 899 goto out;
900 SCpnt = rq->special; 900 SCpnt = rq->special;
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
index a7ea27c01286..9feeb3766d7d 100644
--- a/drivers/scsi/sr.c
+++ b/drivers/scsi/sr.c
@@ -385,10 +385,9 @@ static int sr_init_command(struct scsi_cmnd *SCpnt)
385 int block = 0, this_count, s_size; 385 int block = 0, this_count, s_size;
386 struct scsi_cd *cd; 386 struct scsi_cd *cd;
387 struct request *rq = SCpnt->request; 387 struct request *rq = SCpnt->request;
388 struct scsi_device *sdp = SCpnt->device;
389 int ret; 388 int ret;
390 389
391 ret = scsi_setup_fs_cmnd(sdp, rq); 390 ret = scsi_init_io(SCpnt, GFP_ATOMIC);
392 if (ret != BLKPREP_OK) 391 if (ret != BLKPREP_OK)
393 goto out; 392 goto out;
394 SCpnt = rq->special; 393 SCpnt = rq->special;