lkml.org 
[lkml]   [2008]   [Oct]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 7/7] ide: use queue lock instead of ide_lock when possible
Date
Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> wrote:
> From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> Subject: [PATCH] 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>
> ---
[...]
> Index: b/drivers/ide/ide-io.c
> ===================================================================
> --- a/drivers/ide/ide-io.c
> +++ b/drivers/ide/ide-io.c
[...]
> @@ -1469,16 +1470,16 @@ out:
> void ide_do_drive_cmd(ide_drive_t *drive, struct request *rq)
> {
> ide_hwgroup_t *hwgroup = drive->hwif->hwgroup;
> + struct request_queue *q = drive->queue;
> unsigned long flags;
>
> hwgroup->rq = NULL;
>
> - spin_lock_irqsave(&ide_lock, flags);
> - __elv_add_request(drive->queue, rq, ELEVATOR_INSERT_FRONT, 1);
> - __generic_unplug_device(drive->queue);
> - spin_unlock_irqrestore(&ide_lock, flags);
> + spin_lock_irqsave(q->queue_lock, flags);
> + __elv_add_request(q, rq, ELEVATOR_INSERT_FRONT, 1);
> + __generic_unplug_device(q);

By the way, wouldn't blk_run_queue() be more appropriate here? It looks
to me as if blk_run_queue() was the thing intended for general usage by
low level drivers who don't know and care about schedulers, whereas the
usage of __generic_unplug_device() should mostly be restricted to the
block layer. On the other hand, there are other drivers in
drivers/block/ that use __generic_unplug_device(), so I may well be
wrong. Jens?

Regards,

Elias


\
 
 \ /
  Last update: 2008-10-10 10:51    [W:0.379 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site