[PATCH] libata: move err_mask to ata_queued_cmd

- remove err_mask from the parameter list of the complete functions
  - move err_mask to ata_queued_cmd
  - initialize qc->err_mask when needed
  - for each function call to ata_qc_complete(), replace the err_mask parameter with qc->err_mask.

Signed-off-by: Albert Lee <albertcc@tw.ibm.com>

===============
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
This commit is contained in:
Albert Lee
2005-12-05 15:38:02 +08:00
committed by Jeff Garzik
parent c14b8331ec
commit a22e2eb071
11 changed files with 86 additions and 56 deletions

View File

@ -1203,12 +1203,11 @@ nothing_to_do:
return 1;
}
static int ata_scsi_qc_complete(struct ata_queued_cmd *qc,
unsigned int err_mask)
static int ata_scsi_qc_complete(struct ata_queued_cmd *qc)
{
struct scsi_cmnd *cmd = qc->scsicmd;
u8 *cdb = cmd->cmnd;
int need_sense = (err_mask != 0);
int need_sense = (qc->err_mask != 0);
/* For ATA pass thru (SAT) commands, generate a sense block if
* user mandated it or if there's an error. Note that if we
@ -1955,9 +1954,9 @@ void ata_scsi_badcmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *), u8
done(cmd);
}
static int atapi_sense_complete(struct ata_queued_cmd *qc,unsigned int err_mask)
static int atapi_sense_complete(struct ata_queued_cmd *qc)
{
if (err_mask && ((err_mask & AC_ERR_DEV) == 0))
if (qc->err_mask && ((qc->err_mask & AC_ERR_DEV) == 0))
/* FIXME: not quite right; we don't want the
* translation of taskfile registers into
* a sense descriptors, since that's only
@ -2015,15 +2014,18 @@ static void atapi_request_sense(struct ata_queued_cmd *qc)
qc->complete_fn = atapi_sense_complete;
if (ata_qc_issue(qc))
ata_qc_complete(qc, AC_ERR_OTHER);
if (ata_qc_issue(qc)) {
qc->err_mask |= AC_ERR_OTHER;
ata_qc_complete(qc);
}
DPRINTK("EXIT\n");
}
static int atapi_qc_complete(struct ata_queued_cmd *qc, unsigned int err_mask)
static int atapi_qc_complete(struct ata_queued_cmd *qc)
{
struct scsi_cmnd *cmd = qc->scsicmd;
unsigned int err_mask = qc->err_mask;
VPRINTK("ENTER, err_mask 0x%X\n", err_mask);