ide: ide_lock + __blk_end_request() -> blk_end_request()

Use blk_end_request() instead of ide_lock + __blk_end_request()
in cdrom_end_request(), cdrom_newpc_intr(), __ide_end_request(),
ide_complete_pm_request() and ide_end_drive_cmd().

[ ide_lock is currently also used as queue lock ]
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent a72b2147
...@@ -262,7 +262,6 @@ static void cdrom_end_request(ide_drive_t *drive, int uptodate) ...@@ -262,7 +262,6 @@ static void cdrom_end_request(ide_drive_t *drive, int uptodate)
struct request *failed = (struct request *) rq->buffer; struct request *failed = (struct request *) rq->buffer;
struct cdrom_info *info = drive->driver_data; struct cdrom_info *info = drive->driver_data;
void *sense = &info->sense_data; void *sense = &info->sense_data;
unsigned long flags;
if (failed) { if (failed) {
if (failed->sense) { if (failed->sense) {
...@@ -278,11 +277,9 @@ static void cdrom_end_request(ide_drive_t *drive, int uptodate) ...@@ -278,11 +277,9 @@ static void cdrom_end_request(ide_drive_t *drive, int uptodate)
failed->hard_nr_sectors)) failed->hard_nr_sectors))
BUG(); BUG();
} else { } else {
spin_lock_irqsave(&ide_lock, flags); if (blk_end_request(failed, -EIO,
if (__blk_end_request(failed, -EIO, failed->data_len))
failed->data_len))
BUG(); BUG();
spin_unlock_irqrestore(&ide_lock, flags);
} }
} else } else
cdrom_analyze_sense_data(drive, NULL, sense); cdrom_analyze_sense_data(drive, NULL, sense);
...@@ -1151,16 +1148,13 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive) ...@@ -1151,16 +1148,13 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
end_request: end_request:
if (blk_pc_request(rq)) { if (blk_pc_request(rq)) {
unsigned long flags;
unsigned int dlen = rq->data_len; unsigned int dlen = rq->data_len;
if (dma) if (dma)
rq->data_len = 0; rq->data_len = 0;
spin_lock_irqsave(&ide_lock, flags); if (blk_end_request(rq, 0, dlen))
if (__blk_end_request(rq, 0, dlen))
BUG(); BUG();
spin_unlock_irqrestore(&ide_lock, flags);
hwgroup->rq = NULL; hwgroup->rq = NULL;
} else { } else {
......
...@@ -58,7 +58,6 @@ ...@@ -58,7 +58,6 @@
static int __ide_end_request(ide_drive_t *drive, struct request *rq, static int __ide_end_request(ide_drive_t *drive, struct request *rq,
int uptodate, unsigned int nr_bytes, int dequeue) int uptodate, unsigned int nr_bytes, int dequeue)
{ {
unsigned long flags;
int ret = 1; int ret = 1;
int error = 0; int error = 0;
...@@ -85,10 +84,8 @@ static int __ide_end_request(ide_drive_t *drive, struct request *rq, ...@@ -85,10 +84,8 @@ static int __ide_end_request(ide_drive_t *drive, struct request *rq,
ide_dma_on(drive); ide_dma_on(drive);
} }
spin_lock_irqsave(&ide_lock, flags); if (!blk_end_request(rq, error, nr_bytes))
if (!__blk_end_request(rq, error, nr_bytes))
ret = 0; ret = 0;
spin_unlock_irqrestore(&ide_lock, flags);
if (ret == 0 && dequeue) if (ret == 0 && dequeue)
drive->hwif->hwgroup->rq = NULL; drive->hwif->hwgroup->rq = NULL;
...@@ -267,10 +264,8 @@ static void ide_complete_pm_request (ide_drive_t *drive, struct request *rq) ...@@ -267,10 +264,8 @@ static void ide_complete_pm_request (ide_drive_t *drive, struct request *rq)
drive->hwif->hwgroup->rq = NULL; drive->hwif->hwgroup->rq = NULL;
spin_lock_irqsave(&ide_lock, flags); if (blk_end_request(rq, 0, 0))
if (__blk_end_request(rq, 0, 0))
BUG(); BUG();
spin_unlock_irqrestore(&ide_lock, flags);
} }
/** /**
...@@ -291,7 +286,6 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err) ...@@ -291,7 +286,6 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err)
{ {
ide_hwgroup_t *hwgroup = drive->hwif->hwgroup; ide_hwgroup_t *hwgroup = drive->hwif->hwgroup;
struct request *rq = hwgroup->rq; struct request *rq = hwgroup->rq;
unsigned long flags;
if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) { if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) {
ide_task_t *task = (ide_task_t *)rq->special; ide_task_t *task = (ide_task_t *)rq->special;
...@@ -323,11 +317,9 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err) ...@@ -323,11 +317,9 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err)
rq->errors = err; rq->errors = err;
spin_lock_irqsave(&ide_lock, flags); if (unlikely(blk_end_request(rq, (rq->errors ? -EIO : 0),
if (unlikely(__blk_end_request(rq, (rq->errors ? -EIO : 0), blk_rq_bytes(rq))))
blk_rq_bytes(rq))))
BUG(); BUG();
spin_unlock_irqrestore(&ide_lock, flags);
} }
EXPORT_SYMBOL(ide_end_drive_cmd); EXPORT_SYMBOL(ide_end_drive_cmd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment