Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 208254
b: refs/heads/master
c: afc2306
h: refs/heads/master
v: v3
  • Loading branch information
FUJITA Tomonori authored and Jens Axboe committed Aug 7, 2010
1 parent 607aaa2 commit fd00028
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 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: dd40e456a40ebb87330b7fc694359ce52f1996aa
refs/heads/master: afc23068103ccfbf1917eb2a007bc15ab5418cc9
16 changes: 11 additions & 5 deletions trunk/drivers/ide/ide-disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,10 +427,15 @@ static void ide_disk_unlock_native_capacity(ide_drive_t *drive)
drive->dev_flags |= IDE_DFLAG_NOHPA; /* disable HPA on resume */
}

static void idedisk_prepare_flush(struct request_queue *q, struct request *rq)
static int idedisk_prep_fn(struct request_queue *q, struct request *rq)
{
ide_drive_t *drive = q->queuedata;
struct ide_cmd *cmd = kmalloc(sizeof(*cmd), GFP_ATOMIC);
struct ide_cmd *cmd;

if (!(rq->cmd_flags & REQ_FLUSH))
return BLKPREP_OK;

cmd = kmalloc(sizeof(*cmd), GFP_ATOMIC);

/* FIXME: map struct ide_taskfile on rq->cmd[] */
BUG_ON(cmd == NULL);
Expand All @@ -448,6 +453,8 @@ static void idedisk_prepare_flush(struct request_queue *q, struct request *rq)
rq->cmd_type = REQ_TYPE_ATA_TASKFILE;
rq->special = cmd;
cmd->rq = rq;

return BLKPREP_OK;
}

ide_devset_get(multcount, mult_count);
Expand Down Expand Up @@ -513,7 +520,6 @@ static void update_ordered(ide_drive_t *drive)
{
u16 *id = drive->id;
unsigned ordered = QUEUE_ORDERED_NONE;
prepare_flush_fn *prep_fn = NULL;

if (drive->dev_flags & IDE_DFLAG_WCACHE) {
unsigned long long capacity;
Expand All @@ -538,12 +544,12 @@ static void update_ordered(ide_drive_t *drive)

if (barrier) {
ordered = QUEUE_ORDERED_DRAIN_FLUSH;
prep_fn = idedisk_prepare_flush;
blk_queue_prep_rq(drive->queue, idedisk_prep_fn);
}
} else
ordered = QUEUE_ORDERED_DRAIN;

blk_queue_ordered(drive->queue, ordered, prep_fn);
blk_queue_ordered(drive->queue, ordered, NULL);
}

ide_devset_get_flag(wcache, IDE_DFLAG_WCACHE);
Expand Down

0 comments on commit fd00028

Please sign in to comment.