Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 101201
b: refs/heads/master
c: 64ea1b4
h: refs/heads/master
i:
  101199: fd79583
v: v3
  • Loading branch information
FUJITA Tomonori authored and Bartlomiej Zolnierkiewicz committed Jul 15, 2008
1 parent 6d7ad0f commit 33219bf
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 154ed280e3f48995d0689b57f10b7063add63019
refs/heads/master: 64ea1b4ab7f51c5de601d291a51508c27d445f70
41 changes: 26 additions & 15 deletions trunk/drivers/ide/ide-tape.c
Original file line number Diff line number Diff line change
Expand Up @@ -1519,12 +1519,16 @@ static void idetape_create_test_unit_ready_cmd(struct ide_atapi_pc *pc)
static int idetape_queue_pc_tail(ide_drive_t *drive, struct ide_atapi_pc *pc)
{
struct ide_tape_obj *tape = drive->driver_data;
struct request rq;
struct request *rq;
int error;

idetape_init_rq(&rq, REQ_IDETAPE_PC1);
rq.buffer = (char *) pc;
rq.rq_disk = tape->disk;
return ide_do_drive_cmd(drive, &rq, ide_wait);
rq = blk_get_request(drive->queue, READ, __GFP_WAIT);
rq->cmd_type = REQ_TYPE_SPECIAL;
rq->cmd[0] = REQ_IDETAPE_PC1;
rq->buffer = (char *)pc;
error = blk_execute_rq(drive->queue, tape->disk, rq, 0);
blk_put_request(rq);
return error;
}

static void idetape_create_load_unload_cmd(ide_drive_t *drive,
Expand Down Expand Up @@ -1701,26 +1705,33 @@ static int idetape_queue_rw_tail(ide_drive_t *drive, int cmd, int blocks,
struct idetape_bh *bh)
{
idetape_tape_t *tape = drive->driver_data;
struct request rq;
struct request *rq;
int ret, errors;

debug_log(DBG_SENSE, "%s: cmd=%d\n", __func__, cmd);

idetape_init_rq(&rq, cmd);
rq.rq_disk = tape->disk;
rq.special = (void *)bh;
rq.sector = tape->first_frame;
rq.nr_sectors = blocks;
rq.current_nr_sectors = blocks;
(void) ide_do_drive_cmd(drive, &rq, ide_wait);
rq = blk_get_request(drive->queue, READ, __GFP_WAIT);
rq->cmd_type = REQ_TYPE_SPECIAL;
rq->cmd[0] = cmd;
rq->rq_disk = tape->disk;
rq->special = (void *)bh;
rq->sector = tape->first_frame;
rq->nr_sectors = blocks;
rq->current_nr_sectors = blocks;
blk_execute_rq(drive->queue, tape->disk, rq, 0);

errors = rq->errors;
ret = tape->blk_size * (blocks - rq->current_nr_sectors);
blk_put_request(rq);

if ((cmd & (REQ_IDETAPE_READ | REQ_IDETAPE_WRITE)) == 0)
return 0;

if (tape->merge_bh)
idetape_init_merge_buffer(tape);
if (rq.errors == IDETAPE_ERROR_GENERAL)
if (errors == IDETAPE_ERROR_GENERAL)
return -EIO;
return (tape->blk_size * (blocks-rq.current_nr_sectors));
return ret;
}

static void idetape_create_inquiry_cmd(struct ide_atapi_pc *pc)
Expand Down

0 comments on commit 33219bf

Please sign in to comment.