From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757274AbYHASTl (ORCPT ); Fri, 1 Aug 2008 14:19:41 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751727AbYHASTc (ORCPT ); Fri, 1 Aug 2008 14:19:32 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:44284 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750933AbYHASTb (ORCPT ); Fri, 1 Aug 2008 14:19:31 -0400 Date: Fri, 1 Aug 2008 11:18:45 -0700 (PDT) From: Linus Torvalds To: Jens Axboe cc: Neil Brown , Arthur Jones , Dan Williams , Linux Kernel Mailing List , linux-raid@vger.kernel.org, "Rafael J. Wysocki" Subject: Re: [PULL REQUEST] md bug fixes and minor improvements In-Reply-To: <20080801172231.GF20055@kernel.dk> Message-ID: References: <18578.31924.259887.735206@notabene.brown> <20080801172231.GF20055@kernel.dk> User-Agent: Alpine 1.10 (LFD 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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