aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-12-29 14:27:31 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-12-29 14:27:31 -0500
commit3c8a2cce47c6813383c9e38134e31f7e5f72e9d8 (patch)
tree0779139e88629fe3434fbef6abdb43c78df0ce54 /drivers
parenta72b2147ec9e77be68308ba06190603550d1cb61 (diff)
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: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ide/ide-cd.c12
-rw-r--r--drivers/ide/ide-io.c16
2 files changed, 7 insertions, 21 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 31f398577ed4..ac607bbde45c 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -262,7 +262,6 @@ static void cdrom_end_request(ide_drive_t *drive, int uptodate)
262 struct request *failed = (struct request *) rq->buffer; 262 struct request *failed = (struct request *) rq->buffer;
263 struct cdrom_info *info = drive->driver_data; 263 struct cdrom_info *info = drive->driver_data;
264 void *sense = &info->sense_data; 264 void *sense = &info->sense_data;
265 unsigned long flags;
266 265
267 if (failed) { 266 if (failed) {
268 if (failed->sense) { 267 if (failed->sense) {
@@ -278,11 +277,9 @@ static void cdrom_end_request(ide_drive_t *drive, int uptodate)
278 failed->hard_nr_sectors)) 277 failed->hard_nr_sectors))
279 BUG(); 278 BUG();
280 } else { 279 } else {
281 spin_lock_irqsave(&ide_lock, flags); 280 if (blk_end_request(failed, -EIO,
282 if (__blk_end_request(failed, -EIO, 281 failed->data_len))
283 failed->data_len))
284 BUG(); 282 BUG();
285 spin_unlock_irqrestore(&ide_lock, flags);
286 } 283 }
287 } else 284 } else
288 cdrom_analyze_sense_data(drive, NULL, sense); 285 cdrom_analyze_sense_data(drive, NULL, sense);
@@ -1151,16 +1148,13 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
1151 1148
1152end_request: 1149end_request:
1153 if (blk_pc_request(rq)) { 1150 if (blk_pc_request(rq)) {
1154 unsigned long flags;
1155 unsigned int dlen = rq->data_len; 1151 unsigned int dlen = rq->data_len;
1156 1152
1157 if (dma) 1153 if (dma)
1158 rq->data_len = 0; 1154 rq->data_len = 0;
1159 1155
1160 spin_lock_irqsave(&ide_lock, flags); 1156 if (blk_end_request(rq, 0, dlen))
1161 if (__blk_end_request(rq, 0, dlen))
1162 BUG(); 1157 BUG();
1163 spin_unlock_irqrestore(&ide_lock, flags);
1164 1158
1165 hwgroup->rq = NULL; 1159 hwgroup->rq = NULL;
1166 } else { 1160 } else {
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 709163536015..4a6576f6146b 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -58,7 +58,6 @@
58static int __ide_end_request(ide_drive_t *drive, struct request *rq, 58static int __ide_end_request(ide_drive_t *drive, struct request *rq,
59 int uptodate, unsigned int nr_bytes, int dequeue) 59 int uptodate, unsigned int nr_bytes, int dequeue)
60{ 60{
61 unsigned long flags;
62 int ret = 1; 61 int ret = 1;
63 int error = 0; 62 int error = 0;
64 63
@@ -85,10 +84,8 @@ static int __ide_end_request(ide_drive_t *drive, struct request *rq,
85 ide_dma_on(drive); 84 ide_dma_on(drive);
86 } 85 }
87 86
88 spin_lock_irqsave(&ide_lock, flags); 87 if (!blk_end_request(rq, error, nr_bytes))
89 if (!__blk_end_request(rq, error, nr_bytes))
90 ret = 0; 88 ret = 0;
91 spin_unlock_irqrestore(&ide_lock, flags);
92 89
93 if (ret == 0 && dequeue) 90 if (ret == 0 && dequeue)
94 drive->hwif->hwgroup->rq = NULL; 91 drive->hwif->hwgroup->rq = NULL;
@@ -267,10 +264,8 @@ static void ide_complete_pm_request (ide_drive_t *drive, struct request *rq)
267 264
268 drive->hwif->hwgroup->rq = NULL; 265 drive->hwif->hwgroup->rq = NULL;
269 266
270 spin_lock_irqsave(&ide_lock, flags); 267 if (blk_end_request(rq, 0, 0))
271 if (__blk_end_request(rq, 0, 0))
272 BUG(); 268 BUG();
273 spin_unlock_irqrestore(&ide_lock, flags);
274} 269}
275 270
276/** 271/**
@@ -291,7 +286,6 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err)
291{ 286{
292 ide_hwgroup_t *hwgroup = drive->hwif->hwgroup; 287 ide_hwgroup_t *hwgroup = drive->hwif->hwgroup;
293 struct request *rq = hwgroup->rq; 288 struct request *rq = hwgroup->rq;
294 unsigned long flags;
295 289
296 if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) { 290 if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) {
297 ide_task_t *task = (ide_task_t *)rq->special; 291 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 317
324 rq->errors = err; 318 rq->errors = err;
325 319
326 spin_lock_irqsave(&ide_lock, flags); 320 if (unlikely(blk_end_request(rq, (rq->errors ? -EIO : 0),
327 if (unlikely(__blk_end_request(rq, (rq->errors ? -EIO : 0), 321 blk_rq_bytes(rq))))
328 blk_rq_bytes(rq))))
329 BUG(); 322 BUG();
330 spin_unlock_irqrestore(&ide_lock, flags);
331} 323}
332EXPORT_SYMBOL(ide_end_drive_cmd); 324EXPORT_SYMBOL(ide_end_drive_cmd);
333 325