aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/sd.c50
1 files changed, 29 insertions, 21 deletions
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index b5562b851e78..30a4aa0c8734 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -312,15 +312,19 @@ static int sd_init_command(struct scsi_cmnd * SCpnt)
312 unsigned int this_count = SCpnt->request_bufflen >> 9; 312 unsigned int this_count = SCpnt->request_bufflen >> 9;
313 unsigned int timeout = sdp->timeout; 313 unsigned int timeout = sdp->timeout;
314 314
315 SCSI_LOG_HLQUEUE(1, printk("sd_init_command: disk=%s, block=%llu, " 315 SCSI_LOG_HLQUEUE(1, scmd_printk(KERN_INFO, SCpnt,
316 "count=%d\n", disk->disk_name, 316 "sd_init_command: block=%llu, "
317 (unsigned long long)block, this_count)); 317 "count=%d\n",
318 (unsigned long long)block,
319 this_count));
318 320
319 if (!sdp || !scsi_device_online(sdp) || 321 if (!sdp || !scsi_device_online(sdp) ||
320 block + rq->nr_sectors > get_capacity(disk)) { 322 block + rq->nr_sectors > get_capacity(disk)) {
321 SCSI_LOG_HLQUEUE(2, printk("Finishing %ld sectors\n", 323 SCSI_LOG_HLQUEUE(2, scmd_printk(KERN_INFO, SCpnt,
322 rq->nr_sectors)); 324 "Finishing %ld sectors\n",
323 SCSI_LOG_HLQUEUE(2, printk("Retry with 0x%p\n", SCpnt)); 325 rq->nr_sectors));
326 SCSI_LOG_HLQUEUE(2, scmd_printk(KERN_INFO, SCpnt,
327 "Retry with 0x%p\n", SCpnt));
324 return 0; 328 return 0;
325 } 329 }
326 330
@@ -332,8 +336,8 @@ static int sd_init_command(struct scsi_cmnd * SCpnt)
332 /* printk("SCSI disk has been changed. Prohibiting further I/O.\n"); */ 336 /* printk("SCSI disk has been changed. Prohibiting further I/O.\n"); */
333 return 0; 337 return 0;
334 } 338 }
335 SCSI_LOG_HLQUEUE(2, printk("%s : block=%llu\n", 339 SCSI_LOG_HLQUEUE(2, scmd_printk(KERN_INFO, SCpnt, "block=%llu\n",
336 disk->disk_name, (unsigned long long)block)); 340 (unsigned long long)block));
337 341
338 /* 342 /*
339 * If we have a 1K hardware sectorsize, prevent access to single 343 * If we have a 1K hardware sectorsize, prevent access to single
@@ -390,9 +394,11 @@ static int sd_init_command(struct scsi_cmnd * SCpnt)
390 return 0; 394 return 0;
391 } 395 }
392 396
393 SCSI_LOG_HLQUEUE(2, printk("%s : %s %d/%ld 512 byte blocks.\n", 397 SCSI_LOG_HLQUEUE(2, scmd_printk(KERN_INFO, SCpnt,
394 disk->disk_name, (rq_data_dir(rq) == WRITE) ? 398 "%s %d/%ld 512 byte blocks.\n",
395 "writing" : "reading", this_count, rq->nr_sectors)); 399 (rq_data_dir(rq) == WRITE) ?
400 "writing" : "reading", this_count,
401 rq->nr_sectors));
396 402
397 SCpnt->cmnd[1] = 0; 403 SCpnt->cmnd[1] = 0;
398 404
@@ -494,7 +500,7 @@ static int sd_open(struct inode *inode, struct file *filp)
494 return -ENXIO; 500 return -ENXIO;
495 501
496 502
497 SCSI_LOG_HLQUEUE(3, printk("sd_open: disk=%s\n", disk->disk_name)); 503 SCSI_LOG_HLQUEUE(3, sd_printk(KERN_INFO, sdkp, "sd_open\n"));
498 504
499 sdev = sdkp->device; 505 sdev = sdkp->device;
500 506
@@ -564,7 +570,7 @@ static int sd_release(struct inode *inode, struct file *filp)
564 struct scsi_disk *sdkp = scsi_disk(disk); 570 struct scsi_disk *sdkp = scsi_disk(disk);
565 struct scsi_device *sdev = sdkp->device; 571 struct scsi_device *sdev = sdkp->device;
566 572
567 SCSI_LOG_HLQUEUE(3, printk("sd_release: disk=%s\n", disk->disk_name)); 573 SCSI_LOG_HLQUEUE(3, sdkp_printk(KERN_INFO, sdkp, "sd_release\n"));
568 574
569 if (!--sdkp->openers && sdev->removable) { 575 if (!--sdkp->openers && sdev->removable) {
570 if (scsi_block_when_processing_errors(sdev)) 576 if (scsi_block_when_processing_errors(sdev))
@@ -677,8 +683,7 @@ static int sd_media_changed(struct gendisk *disk)
677 struct scsi_device *sdp = sdkp->device; 683 struct scsi_device *sdp = sdkp->device;
678 int retval; 684 int retval;
679 685
680 SCSI_LOG_HLQUEUE(3, printk("sd_media_changed: disk=%s\n", 686 SCSI_LOG_HLQUEUE(3, sd_printk(KERN_INFO, sdkp, "sd_media_changed\n"));
681 disk->disk_name));
682 687
683 if (!sdp->removable) 688 if (!sdp->removable)
684 return 0; 689 return 0;
@@ -871,12 +876,14 @@ static void sd_rw_intr(struct scsi_cmnd * SCpnt)
871 sense_deferred = scsi_sense_is_deferred(&sshdr); 876 sense_deferred = scsi_sense_is_deferred(&sshdr);
872 } 877 }
873#ifdef CONFIG_SCSI_LOGGING 878#ifdef CONFIG_SCSI_LOGGING
874 SCSI_LOG_HLCOMPLETE(1, printk("sd_rw_intr: %s: res=0x%x\n", 879 SCSI_LOG_HLCOMPLETE(1, scsi_print_result(SCpnt));
875 SCpnt->request->rq_disk->disk_name, result));
876 if (sense_valid) { 880 if (sense_valid) {
877 SCSI_LOG_HLCOMPLETE(1, printk("sd_rw_intr: sb[respc,sk,asc," 881 SCSI_LOG_HLCOMPLETE(1, scmd_printk(KERN_INFO, SCpnt,
878 "ascq]=%x,%x,%x,%x\n", sshdr.response_code, 882 "sd_rw_intr: sb[respc,sk,asc,"
879 sshdr.sense_key, sshdr.asc, sshdr.ascq)); 883 "ascq]=%x,%x,%x,%x\n",
884 sshdr.response_code,
885 sshdr.sense_key, sshdr.asc,
886 sshdr.ascq));
880 } 887 }
881#endif 888#endif
882 if (driver_byte(result) != DRIVER_SENSE && 889 if (driver_byte(result) != DRIVER_SENSE &&
@@ -1467,7 +1474,8 @@ static int sd_revalidate_disk(struct gendisk *disk)
1467 unsigned char *buffer; 1474 unsigned char *buffer;
1468 unsigned ordered; 1475 unsigned ordered;
1469 1476
1470 SCSI_LOG_HLQUEUE(3, printk("sd_revalidate_disk: disk=%s\n", disk->disk_name)); 1477 SCSI_LOG_HLQUEUE(3, sd_printk(KERN_INFO, sdkp,
1478 "sd_revalidate_disk\n"));
1471 1479
1472 /* 1480 /*
1473 * If the device is offline, don't try and read capacity or any 1481 * If the device is offline, don't try and read capacity or any