From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tejun Heo Subject: Re: [patch] block: bd_start_claiming cleanup Date: Tue, 25 May 2010 19:30:09 +0200 Message-ID: <4BFC0921.4000800@kernel.org> References: <20100525155021.GC20853@laptop> <20100525155119.GD20853@laptop> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: linux-fsdevel@vger.kernel.org, Jens Axboe , Andrew Morton To: Nick Piggin Return-path: Received: from hera.kernel.org ([140.211.167.34]:57999 "EHLO hera.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753885Ab0EYRaS (ORCPT ); Tue, 25 May 2010 13:30:18 -0400 In-Reply-To: <20100525155119.GD20853@laptop> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hello, Nick. On 05/25/2010 05:51 PM, Nick Piggin wrote: > I don't like the subtle multi-context code in bd_claim (ie. detects where it > has been called based on bd_claiming). It seems clearer to just require a new > function to finish a 2-part claim. Oh yeah, that looks much better. What was I thinking? :-) > Also improve commentary in bd_start_claiming as to how it should > be used. > > Signed-off-by: Nick Piggin Acked-by: Tejun Heo but one small nit. > +static void bd_finish_claiming(struct block_device *bdev, > + struct block_device *whole, void *holder) > +{ > + spin_lock(&bdev_lock); > + BUG_ON(whole->bd_claiming != holder); The above test is already done in __bd_abort_claiming(). > + BUG_ON(!bd_may_claim(bdev, whole, holder)); > + __bd_claim(bdev, whole, holder); > + __bd_abort_claiming(whole, holder); /* not actually an abort */ > +} Thanks. -- tejun