aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r--drivers/scsi/scsi_lib.c37
1 files changed, 17 insertions, 20 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 3ff538809786..e40c8b66da40 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -951,15 +951,13 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes,
951 return; 951 return;
952 } 952 }
953 if (!(req->flags & REQ_QUIET)) 953 if (!(req->flags & REQ_QUIET))
954 dev_printk(KERN_INFO, 954 scmd_printk(KERN_INFO, cmd,
955 &cmd->device->sdev_gendev,
956 "Device not ready.\n"); 955 "Device not ready.\n");
957 scsi_end_request(cmd, 0, this_count, 1); 956 scsi_end_request(cmd, 0, this_count, 1);
958 return; 957 return;
959 case VOLUME_OVERFLOW: 958 case VOLUME_OVERFLOW:
960 if (!(req->flags & REQ_QUIET)) { 959 if (!(req->flags & REQ_QUIET)) {
961 dev_printk(KERN_INFO, 960 scmd_printk(KERN_INFO, cmd,
962 &cmd->device->sdev_gendev,
963 "Volume overflow, CDB: "); 961 "Volume overflow, CDB: ");
964 __scsi_print_command(cmd->data_cmnd); 962 __scsi_print_command(cmd->data_cmnd);
965 scsi_print_sense("", cmd); 963 scsi_print_sense("", cmd);
@@ -981,7 +979,7 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes,
981 } 979 }
982 if (result) { 980 if (result) {
983 if (!(req->flags & REQ_QUIET)) { 981 if (!(req->flags & REQ_QUIET)) {
984 dev_printk(KERN_INFO, &cmd->device->sdev_gendev, 982 scmd_printk(KERN_INFO, cmd,
985 "SCSI error: return code = 0x%x\n", result); 983 "SCSI error: return code = 0x%x\n", result);
986 984
987 if (driver_byte(result) & DRIVER_SENSE) 985 if (driver_byte(result) & DRIVER_SENSE)
@@ -1141,8 +1139,8 @@ static int scsi_prep_fn(struct request_queue *q, struct request *req)
1141 * online before trying any recovery commands 1139 * online before trying any recovery commands
1142 */ 1140 */
1143 if (unlikely(!scsi_device_online(sdev))) { 1141 if (unlikely(!scsi_device_online(sdev))) {
1144 printk(KERN_ERR "scsi%d (%d:%d): rejecting I/O to offline device\n", 1142 sdev_printk(KERN_ERR, sdev,
1145 sdev->host->host_no, sdev->id, sdev->lun); 1143 "rejecting I/O to offline device\n");
1146 goto kill; 1144 goto kill;
1147 } 1145 }
1148 if (unlikely(sdev->sdev_state != SDEV_RUNNING)) { 1146 if (unlikely(sdev->sdev_state != SDEV_RUNNING)) {
@@ -1151,8 +1149,8 @@ static int scsi_prep_fn(struct request_queue *q, struct request *req)
1151 if (sdev->sdev_state == SDEV_DEL) { 1149 if (sdev->sdev_state == SDEV_DEL) {
1152 /* Device is fully deleted, no commands 1150 /* Device is fully deleted, no commands
1153 * at all allowed down */ 1151 * at all allowed down */
1154 printk(KERN_ERR "scsi%d (%d:%d): rejecting I/O to dead device\n", 1152 sdev_printk(KERN_ERR, sdev,
1155 sdev->host->host_no, sdev->id, sdev->lun); 1153 "rejecting I/O to dead device\n");
1156 goto kill; 1154 goto kill;
1157 } 1155 }
1158 /* OK, we only allow special commands (i.e. not 1156 /* OK, we only allow special commands (i.e. not
@@ -1187,8 +1185,8 @@ static int scsi_prep_fn(struct request_queue *q, struct request *req)
1187 specials_only == SDEV_BLOCK) 1185 specials_only == SDEV_BLOCK)
1188 goto defer; 1186 goto defer;
1189 1187
1190 printk(KERN_ERR "scsi%d (%d:%d): rejecting I/O to device being removed\n", 1188 sdev_printk(KERN_ERR, sdev,
1191 sdev->host->host_no, sdev->id, sdev->lun); 1189 "rejecting I/O to device being removed\n");
1192 goto kill; 1190 goto kill;
1193 } 1191 }
1194 1192
@@ -1315,9 +1313,8 @@ static inline int scsi_dev_queue_ready(struct request_queue *q,
1315 */ 1313 */
1316 if (--sdev->device_blocked == 0) { 1314 if (--sdev->device_blocked == 0) {
1317 SCSI_LOG_MLQUEUE(3, 1315 SCSI_LOG_MLQUEUE(3,
1318 printk("scsi%d (%d:%d) unblocking device at" 1316 sdev_printk(KERN_INFO, sdev,
1319 " zero depth\n", sdev->host->host_no, 1317 "unblocking device at zero depth\n"));
1320 sdev->id, sdev->lun));
1321 } else { 1318 } else {
1322 blk_plug_device(q); 1319 blk_plug_device(q);
1323 return 0; 1320 return 0;
@@ -1436,8 +1433,8 @@ static void scsi_request_fn(struct request_queue *q)
1436 break; 1433 break;
1437 1434
1438 if (unlikely(!scsi_device_online(sdev))) { 1435 if (unlikely(!scsi_device_online(sdev))) {
1439 printk(KERN_ERR "scsi%d (%d:%d): rejecting I/O to offline device\n", 1436 sdev_printk(KERN_ERR, sdev,
1440 sdev->host->host_no, sdev->id, sdev->lun); 1437 "rejecting I/O to offline device\n");
1441 scsi_kill_request(req, q); 1438 scsi_kill_request(req, q);
1442 continue; 1439 continue;
1443 } 1440 }
@@ -1893,10 +1890,10 @@ scsi_device_set_state(struct scsi_device *sdev, enum scsi_device_state state)
1893 1890
1894 illegal: 1891 illegal:
1895 SCSI_LOG_ERROR_RECOVERY(1, 1892 SCSI_LOG_ERROR_RECOVERY(1,
1896 dev_printk(KERN_ERR, &sdev->sdev_gendev, 1893 sdev_printk(KERN_ERR, sdev,
1897 "Illegal state transition %s->%s\n", 1894 "Illegal state transition %s->%s\n",
1898 scsi_device_state_name(oldstate), 1895 scsi_device_state_name(oldstate),
1899 scsi_device_state_name(state)) 1896 scsi_device_state_name(state))
1900 ); 1897 );
1901 return -EINVAL; 1898 return -EINVAL;
1902} 1899}