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
commit6ea52226ca131a99bb619bd56fbeee566ea5a966 (patch)
treefdb88ece25f8c89ccdcf7a149d8321d8f4b33c9e /drivers
parent3c8a2cce47c6813383c9e38134e31f7e5f72e9d8 (diff)
ide: use queue lock instead of ide_lock when possible
This is just a preparation for future changes and there should be no functional changes caused by this patch since 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.c14
-rw-r--r--drivers/ide/ide-io.c19
2 files changed, 18 insertions, 15 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index ac607bbde45c..692fd4570df6 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -424,16 +424,17 @@ static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret)
424 if (time_after(jiffies, info->write_timeout)) 424 if (time_after(jiffies, info->write_timeout))
425 do_end_request = 1; 425 do_end_request = 1;
426 else { 426 else {
427 struct request_queue *q = drive->queue;
427 unsigned long flags; 428 unsigned long flags;
428 429
429 /* 430 /*
430 * take a breather relying on the unplug 431 * take a breather relying on the unplug
431 * timer to kick us again 432 * timer to kick us again
432 */ 433 */
433 spin_lock_irqsave(&ide_lock, flags); 434 spin_lock_irqsave(q->queue_lock, flags);
434 blk_plug_device(drive->queue); 435 blk_plug_device(q);
435 spin_unlock_irqrestore(&ide_lock, 436 spin_unlock_irqrestore(q->queue_lock, flags);
436 flags); 437
437 return 1; 438 return 1;
438 } 439 }
439 } 440 }
@@ -502,11 +503,12 @@ static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret)
502 503
503end_request: 504end_request:
504 if (stat & ATA_ERR) { 505 if (stat & ATA_ERR) {
506 struct request_queue *q = drive->queue;
505 unsigned long flags; 507 unsigned long flags;
506 508
507 spin_lock_irqsave(&ide_lock, flags); 509 spin_lock_irqsave(q->queue_lock, flags);
508 blkdev_dequeue_request(rq); 510 blkdev_dequeue_request(rq);
509 spin_unlock_irqrestore(&ide_lock, flags); 511 spin_unlock_irqrestore(q->queue_lock, flags);
510 512
511 hwgroup->rq = NULL; 513 hwgroup->rq = NULL;
512 514
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 4a6576f6146b..02059e96e6cd 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -247,20 +247,21 @@ EXPORT_SYMBOL_GPL(ide_end_dequeued_request);
247 */ 247 */
248static void ide_complete_pm_request (ide_drive_t *drive, struct request *rq) 248static void ide_complete_pm_request (ide_drive_t *drive, struct request *rq)
249{ 249{
250 struct request_queue *q = drive->queue;
250 unsigned long flags; 251 unsigned long flags;
251 252
252#ifdef DEBUG_PM 253#ifdef DEBUG_PM
253 printk("%s: completing PM request, %s\n", drive->name, 254 printk("%s: completing PM request, %s\n", drive->name,
254 blk_pm_suspend_request(rq) ? "suspend" : "resume"); 255 blk_pm_suspend_request(rq) ? "suspend" : "resume");
255#endif 256#endif
256 spin_lock_irqsave(&ide_lock, flags); 257 spin_lock_irqsave(q->queue_lock, flags);
257 if (blk_pm_suspend_request(rq)) { 258 if (blk_pm_suspend_request(rq)) {
258 blk_stop_queue(drive->queue); 259 blk_stop_queue(q);
259 } else { 260 } else {
260 drive->dev_flags &= ~IDE_DFLAG_BLOCKED; 261 drive->dev_flags &= ~IDE_DFLAG_BLOCKED;
261 blk_start_queue(drive->queue); 262 blk_start_queue(q);
262 } 263 }
263 spin_unlock_irqrestore(&ide_lock, flags); 264 spin_unlock_irqrestore(q->queue_lock, flags);
264 265
265 drive->hwif->hwgroup->rq = NULL; 266 drive->hwif->hwgroup->rq = NULL;
266 267
@@ -1469,16 +1470,16 @@ out:
1469void ide_do_drive_cmd(ide_drive_t *drive, struct request *rq) 1470void ide_do_drive_cmd(ide_drive_t *drive, struct request *rq)
1470{ 1471{
1471 ide_hwgroup_t *hwgroup = drive->hwif->hwgroup; 1472 ide_hwgroup_t *hwgroup = drive->hwif->hwgroup;
1473 struct request_queue *q = drive->queue;
1472 unsigned long flags; 1474 unsigned long flags;
1473 1475
1474 hwgroup->rq = NULL; 1476 hwgroup->rq = NULL;
1475 1477
1476 spin_lock_irqsave(&ide_lock, flags); 1478 spin_lock_irqsave(q->queue_lock, flags);
1477 __elv_add_request(drive->queue, rq, ELEVATOR_INSERT_FRONT, 0); 1479 __elv_add_request(q, rq, ELEVATOR_INSERT_FRONT, 0);
1478 blk_start_queueing(drive->queue); 1480 blk_start_queueing(q);
1479 spin_unlock_irqrestore(&ide_lock, flags); 1481 spin_unlock_irqrestore(q->queue_lock, flags);
1480} 1482}
1481
1482EXPORT_SYMBOL(ide_do_drive_cmd); 1483EXPORT_SYMBOL(ide_do_drive_cmd);
1483 1484
1484void ide_pktcmd_tf_load(ide_drive_t *drive, u32 tf_flags, u16 bcount, u8 dma) 1485void ide_pktcmd_tf_load(ide_drive_t *drive, u32 tf_flags, u16 bcount, u8 dma)