linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Nick Piggin <npiggin@suse.de>
Cc: linux-fsdevel@vger.kernel.org, Jens Axboe <jens.axboe@oracle.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [patch] block: bd_start_claiming cleanup
Date: Tue, 25 May 2010 19:30:09 +0200	[thread overview]
Message-ID: <4BFC0921.4000800@kernel.org> (raw)
In-Reply-To: <20100525155119.GD20853@laptop>

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 <npiggin@suse.de>

Acked-by: Tejun Heo <tj@kernel.org>

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

  reply	other threads:[~2010-05-25 17:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-25 15:50 [patch] block: bd_start_claiming fix module refcount Nick Piggin
2010-05-25 15:51 ` [patch] block: bd_start_claiming cleanup Nick Piggin
2010-05-25 17:30   ` Tejun Heo [this message]
2010-05-25 17:03 ` [patch] block: bd_start_claiming fix module refcount Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BFC0921.4000800@kernel.org \
    --to=tj@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=jens.axboe@oracle.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=npiggin@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).