lkml.org 
[lkml]   [2008]   [Aug]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PULL REQUEST] md bug fixes and minor improvements


On Fri, 1 Aug 2008, Jens Axboe wrote:
> + spin_lock_irq(&bitmap->mddev->queue->queue_lock);
> blk_plug_device(bitmap->mddev->queue);
> + spin_unlock_irq(&bitmap->mddev->queue->queue_lock);

Can we please not have a chain of three dereferences in a row like that?
That's an almost certain sign that we should either have a helper function
or just a variable, and do it as

queue = bitmap->mddev->queue;

spin_lock_irq(&queue->queue_lock);
blk_plug_device(queue);
spin_unlock_irq(&queue->queue_lock);

Hmm? Perhaps the helper function is cleaner, ie

static inline blk_plug_device_unlocked(struct request_queue * queue)
{..

instead. That, of course, would have to use spin_lock_irqsave().

Linus


\
 
 \ /
  Last update: 2008-08-01 20:21    [W:0.045 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site