linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Mason <chris.mason@oracle.com>
To: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
Cc: David Sterba <dsterba@suse.cz>,
	linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH 05/12] btrfs: remove useless mutex lock/unlock sequences
Date: Mon, 25 Apr 2011 08:12:59 -0400	[thread overview]
Message-ID: <1303733509-sup-4508@think> (raw)
In-Reply-To: <4DB513F6.6040503@jp.fujitsu.com>

Excerpts from Tsutomu Itoh's message of 2011-04-25 02:25:58 -0400:
> (2011/04/22 18:41), David Sterba wrote:
> > Signed-off-by: David Sterba <dsterba@suse.cz>
> > ---
> >  fs/btrfs/extent-tree.c |    6 ------
> >  1 files changed, 0 insertions(+), 6 deletions(-)
> > 
> > diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
> > index 31f33ba..c97ceab 100644
> > --- a/fs/btrfs/extent-tree.c
> > +++ b/fs/btrfs/extent-tree.c
> > @@ -756,8 +756,6 @@ again:
> >  
> >              btrfs_release_path(root->fs_info->extent_root, path);
> >  
> > -            mutex_lock(&head->mutex);
> > -            mutex_unlock(&head->mutex);
> >              btrfs_put_delayed_ref(&head->node);
> >              goto again;
> 
> This code tests whether the mutex_lock can be acquired, and when the
> mutex_lock can be taken, it try again.
> So I think that it is not a meaningless code.

Correct, this code is waiting for the current lock holder to finish.
It's not exactly pretty but it needs to stay.

-chris

  reply	other threads:[~2011-04-25 12:12 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-22  9:41 [PATCH 00/12] Cleanups, cruft removal David Sterba
2011-04-22  9:41 ` [PATCH 01/12] btrfs: rename variables clashing with global function names David Sterba
2011-04-22  9:41 ` [PATCH 02/12] btrfs: remove nested duplicate variable declarations David Sterba
2011-04-22  9:41 ` [PATCH 03/12] btrfs: fix dereference before check David Sterba
2011-04-22  9:41 ` [PATCH 04/12] btrfs: unify checking of IS_ERR and null David Sterba
2011-04-22  9:41 ` [PATCH 05/12] btrfs: remove useless mutex lock/unlock sequences David Sterba
2011-04-25  6:25   ` Tsutomu Itoh
2011-04-25 12:12     ` Chris Mason [this message]
2011-04-29 16:34       ` David Sterba
2011-05-02 13:49   ` [PATCH] btrfs: Document a mutex lock/unlock sequence David Sterba
2011-04-22  9:41 ` [PATCH 06/12] btrfs: make functions static when possible David Sterba
2011-04-22  9:42 ` [PATCH 07/12] btrfs: drop unused argument from extent_io_tree_init David Sterba
2011-04-22  9:42 ` [PATCH 08/12] btrfs: drop unused parameter from extent_map_tree_init David Sterba
2011-04-22  9:42 ` [PATCH 09/12] btrfs: drop gfp parameter from alloc_extent_map David Sterba
2011-04-22  9:42 ` [PATCH 10/12] btrfs: drop gfp parameter from find_extent_buffer David Sterba
2011-04-22  9:43 ` [PATCH 11/12] btrfs: drop gfp parameter from alloc_extent_buffer David Sterba
2011-04-22  9:43 ` [PATCH 12/12] btrfs: drop unused parameter from btrfs_release_path David Sterba
2011-05-02 14:01 ` [PATCH 00/12] Cleanups, cruft removal David Sterba

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=1303733509-sup-4508@think \
    --to=chris.mason@oracle.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=t-itoh@jp.fujitsu.com \
    /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).