Commit 9ccfc756 authored by James Bottomley's avatar James Bottomley Committed by James Bottomley
Browse files

[SCSI] move the mid-layer printk's over to shost/starget/sdev_printk



This should eliminate (at least in the mid layer) to make numeric
assumptions about any of the enumeration variables.  As a side effect,
it will also make all the messages consistent and line us up nicely for
the error logging strategy (if it ever shows itself again).

Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 9a41a62b
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -1389,10 +1389,7 @@ EXPORT_SYMBOL(scsi_print_msg);
void scsi_print_command(struct scsi_cmnd *cmd)
{
	/* Assume appended output (i.e. not at start of line) */
	printk("scsi%d : destination target %d, lun %d\n", 
		cmd->device->host->host_no, 
		cmd->device->id, 
		cmd->device->lun);
	sdev_printk("", cmd->device, "\n");
	printk(KERN_INFO "        command: ");
	scsi_print_cdb(cmd->cmnd, cmd->cmd_len, 0);
}
+5 −5
Original line number Diff line number Diff line
@@ -139,7 +139,7 @@ int scsi_host_set_state(struct Scsi_Host *shost, enum scsi_host_state state)

 illegal:
	SCSI_LOG_ERROR_RECOVERY(1,
				dev_printk(KERN_ERR, &shost->shost_gendev,
				shost_printk(KERN_ERR, shost,
					     "Illegal host state transition"
					     "%s->%s\n",
					     scsi_host_state_name(oldstate),
+3 −3
Original line number Diff line number Diff line
@@ -5819,9 +5819,9 @@ static int osst_probe(struct device *dev)
	}
	drive->number = devfs_register_tape(SDp->devfs_name);

	printk(KERN_INFO
		"osst :I: Attached OnStream %.5s tape at scsi%d, channel %d, id %d, lun %d as %s\n",
		SDp->model, SDp->host->host_no, SDp->channel, SDp->id, SDp->lun, tape_name(tpnt));
	dev_printk(KERN_INFO, &SDp->sdev_gendev,
		"osst :I: Attached OnStream %.5s tape as %s\n",
		SDp->model, tape_name(tpnt));

	return 0;

+8 −13
Original line number Diff line number Diff line
@@ -410,9 +410,7 @@ void scsi_log_send(struct scsi_cmnd *cmd)
				       SCSI_LOG_MLQUEUE_BITS);
		if (level > 1) {
			sdev = cmd->device;
			printk(KERN_INFO "scsi <%d:%d:%d:%d> send ",
			       sdev->host->host_no, sdev->channel, sdev->id,
			       sdev->lun);
			sdev_printk(KERN_INFO, sdev, "send ");
			if (level > 2)
				printk("0x%p ", cmd);
			/*
@@ -456,9 +454,7 @@ void scsi_log_completion(struct scsi_cmnd *cmd, int disposition)
		if (((level > 0) && (cmd->result || disposition != SUCCESS)) ||
		    (level > 1)) {
			sdev = cmd->device;
			printk(KERN_INFO "scsi <%d:%d:%d:%d> done ",
			       sdev->host->host_no, sdev->channel, sdev->id,
			       sdev->lun);
			sdev_printk(KERN_INFO, sdev, "done ");
			if (level > 2)
				printk("0x%p ", cmd);
			/*
@@ -810,7 +806,7 @@ static void scsi_softirq(struct softirq_action *h)
		disposition = scsi_decide_disposition(cmd);
		if (disposition != SUCCESS &&
		    time_before(cmd->jiffies_at_alloc + wait_for, jiffies)) {
			dev_printk(KERN_ERR, &cmd->device->sdev_gendev, 
			sdev_printk(KERN_ERR, cmd->device,
				    "timing out command, waited %lus\n",
				    wait_for/HZ);
			disposition = SUCCESS;
@@ -970,10 +966,9 @@ void scsi_adjust_queue_depth(struct scsi_device *sdev, int tagged, int tags)
			sdev->simple_tags = 1;
			break;
		default:
			printk(KERN_WARNING "(scsi%d:%d:%d:%d) "
			sdev_printk(KERN_WARNING, sdev,
				    "scsi_adjust_queue_depth, bad queue type, "
				"disabled\n", sdev->host->host_no,
				sdev->channel, sdev->id, sdev->lun); 
				    "disabled\n");
		case 0:
			sdev->ordered_tags = sdev->simple_tags = 0;
			sdev->queue_depth = tags;
+9 −16
Original line number Diff line number Diff line
@@ -241,11 +241,10 @@ static inline void scsi_eh_prt_fail_stats(struct Scsi_Host *shost,

		if (cmd_cancel || cmd_failed) {
			SCSI_LOG_ERROR_RECOVERY(3,
				printk("%s: %d:%d:%d:%d cmds failed: %d,"
				       " cancel: %d\n",
				       __FUNCTION__, shost->host_no,
				       sdev->channel, sdev->id, sdev->lun,
				       cmd_failed, cmd_cancel));
				sdev_printk(KERN_INFO, sdev,
					    "%s: cmds failed: %d, cancel: %d\n",
					    __FUNCTION__, cmd_failed,
					    cmd_cancel));
			cmd_cancel = 0;
			cmd_failed = 0;
			++devices_failed;
@@ -1174,13 +1173,9 @@ static void scsi_eh_offline_sdevs(struct list_head *work_q,
	struct scsi_cmnd *scmd, *next;

	list_for_each_entry_safe(scmd, next, work_q, eh_entry) {
		printk(KERN_INFO "scsi: Device offlined - not"
		       		" ready after error recovery: host"
				" %d channel %d id %d lun %d\n",
				scmd->device->host->host_no,
				scmd->device->channel,
				scmd->device->id,
				scmd->device->lun);
		sdev_printk(KERN_INFO, scmd->device,
			    "scsi: Device offlined - not"
			    " ready after error recovery\n");
		scsi_device_set_state(scmd->device, SDEV_OFFLINE);
		if (scmd->eh_eflags & SCSI_EH_CANCEL_CMD) {
			/*
@@ -1342,10 +1337,8 @@ int scsi_decide_disposition(struct scsi_cmnd *scmd)
		return SUCCESS;

	case RESERVATION_CONFLICT:
		printk(KERN_INFO "scsi: reservation conflict: host"
                                " %d channel %d id %d lun %d\n",
		       scmd->device->host->host_no, scmd->device->channel,
		       scmd->device->id, scmd->device->lun);
		sdev_printk(KERN_INFO, scmd->device,
			    "reservation conflict\n");
		return SUCCESS; /* causes immediate i/o error */
	default:
		return FAILED;
Loading