diff options
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r-- | drivers/scsi/scsi_lib.c | 22 |
1 files changed, 12 insertions, 10 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) | |||
1082 | EXPORT_SYMBOL(scsi_setup_blk_pc_cmnd); | 1082 | EXPORT_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 | */ |
1089 | int scsi_setup_fs_cmnd(struct scsi_device *sdev, struct request *req) | 1088 | static 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 | } |
1103 | EXPORT_SYMBOL(scsi_setup_fs_cmnd); | ||
1104 | 1102 | ||
1105 | static int | 1103 | static int |
1106 | scsi_prep_state_check(struct scsi_device *sdev, struct request *req) | 1104 | scsi_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 | ||
1215 | out: | 1217 | out: |
1216 | return scsi_prep_return(q, req, ret); | 1218 | return scsi_prep_return(q, req, ret); |