ide-atapi: use local sense buffer

Access the sense buffer through the bio in ->pc_callback method thus
alleviating the need for the pc->buf pointer.

There should be no functional change resulting from this patch.

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
This commit is contained in:
Borislav Petkov 2009-05-02 10:58:17 +02:00
parent 5122e5174f
commit ae3a8387be
3 changed files with 8 additions and 4 deletions

View File

@ -253,7 +253,9 @@ void ide_retry_pc(ide_drive_t *drive)
/* init pc from sense_rq */ /* init pc from sense_rq */
ide_init_pc(pc); ide_init_pc(pc);
memcpy(pc->c, sense_rq->cmd, 12); memcpy(pc->c, sense_rq->cmd, 12);
pc->buf = bio_data(sense_rq->bio); /* pointer to mapped address */
/* pointer to mapped address */
pc->buf = bio_data(sense_rq->bio);
pc->req_xfer = blk_rq_bytes(sense_rq); pc->req_xfer = blk_rq_bytes(sense_rq);
if (drive->media == ide_tape) if (drive->media == ide_tape)

View File

@ -77,7 +77,8 @@ static int ide_floppy_callback(ide_drive_t *drive, int dsc)
(rq && blk_pc_request(rq))) (rq && blk_pc_request(rq)))
uptodate = 1; /* FIXME */ uptodate = 1; /* FIXME */
else if (pc->c[0] == GPCMD_REQUEST_SENSE) { else if (pc->c[0] == GPCMD_REQUEST_SENSE) {
u8 *buf = pc->buf;
u8 *buf = bio_data(rq->bio);
if (!pc->error) { if (!pc->error) {
floppy->sense_key = buf[2] & 0x0F; floppy->sense_key = buf[2] & 0x0F;

View File

@ -288,11 +288,12 @@ static struct ide_tape_obj *ide_tape_chrdev_get(unsigned int i)
* called on each failed packet command retry to analyze the request sense. We * called on each failed packet command retry to analyze the request sense. We
* currently do not utilize this information. * currently do not utilize this information.
*/ */
static void idetape_analyze_error(ide_drive_t *drive, u8 *sense) static void idetape_analyze_error(ide_drive_t *drive)
{ {
idetape_tape_t *tape = drive->driver_data; idetape_tape_t *tape = drive->driver_data;
struct ide_atapi_pc *pc = drive->failed_pc; struct ide_atapi_pc *pc = drive->failed_pc;
struct request *rq = drive->hwif->rq; struct request *rq = drive->hwif->rq;
u8 *sense = bio_data(rq->bio);
tape->sense_key = sense[2] & 0xF; tape->sense_key = sense[2] & 0xF;
tape->asc = sense[12]; tape->asc = sense[12];
@ -362,7 +363,7 @@ static int ide_tape_callback(ide_drive_t *drive, int dsc)
if (pc->c[0] == REQUEST_SENSE) { if (pc->c[0] == REQUEST_SENSE) {
if (uptodate) if (uptodate)
idetape_analyze_error(drive, pc->buf); idetape_analyze_error(drive);
else else
printk(KERN_ERR "ide-tape: Error in REQUEST SENSE " printk(KERN_ERR "ide-tape: Error in REQUEST SENSE "
"itself - Aborting request!\n"); "itself - Aborting request!\n");