All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josef Bacik <jbacik@fusionio.com>
To: Jan Schmidt <list.btrfs@jan-o-sch.net>
Cc: Josef Bacik <jbacik@fusionio.com>,
	linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] Btrfs: stop using GFP_ATOMIC when allocating rewind ebs
Date: Thu, 8 Aug 2013 09:12:17 -0400	[thread overview]
Message-ID: <20130808131217.GC16712@localhost.localdomain> (raw)
In-Reply-To: <5203475A.9070705@jan-o-sch.net>

On Thu, Aug 08, 2013 at 09:23:06AM +0200, Jan Schmidt wrote:
>  
> On Wed, August 07, 2013 at 23:11 (+0200), Josef Bacik wrote:
> > There is no reason we can't just set the path to blocking and then do normal
> > GFP_NOFS allocations for these extent buffers.  Thanks,
> > 
> > Signed-off-by: Josef Bacik <jbacik@fusionio.com>
> > ---
> >  fs/btrfs/ctree.c     |   16 ++++++++++------
> >  fs/btrfs/extent_io.c |    8 ++++----
> >  2 files changed, 14 insertions(+), 10 deletions(-)
> > 
> > diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
> > index 1dd8a71..414a2d7 100644
> > --- a/fs/btrfs/ctree.c
> > +++ b/fs/btrfs/ctree.c
> > @@ -1191,8 +1191,8 @@ __tree_mod_log_rewind(struct btrfs_fs_info *fs_info, struct extent_buffer *eb,
> >   * is freed (its refcount is decremented).
> >   */
> >  static struct extent_buffer *
> > -tree_mod_log_rewind(struct btrfs_fs_info *fs_info, struct extent_buffer *eb,
> > -		    u64 time_seq)
> > +tree_mod_log_rewind(struct btrfs_fs_info *fs_info, struct btrfs_path *path,
> > +		    struct extent_buffer *eb, u64 time_seq)
> >  {
> >  	struct extent_buffer *eb_rewin;
> >  	struct tree_mod_elem *tm;
> > @@ -1207,12 +1207,15 @@ tree_mod_log_rewind(struct btrfs_fs_info *fs_info, struct extent_buffer *eb,
> >  	if (!tm)
> >  		return eb;
> >  
> > +	btrfs_set_path_blocking(path);
> > +	btrfs_set_lock_blocking_rw(eb, BTRFS_READ_LOCK);
> > +
> >  	if (tm->op == MOD_LOG_KEY_REMOVE_WHILE_FREEING) {
> >  		BUG_ON(tm->slot != 0);
> >  		eb_rewin = alloc_dummy_extent_buffer(eb->start,
> >  						fs_info->tree_root->nodesize);
> >  		if (!eb_rewin) {
> > -			btrfs_tree_read_unlock(eb);
> > +			btrfs_tree_read_unlock_blocking(eb);
> >  			free_extent_buffer(eb);
> >  			return NULL;
> >  		}
> > @@ -1224,13 +1227,14 @@ tree_mod_log_rewind(struct btrfs_fs_info *fs_info, struct extent_buffer *eb,
> >  	} else {
> >  		eb_rewin = btrfs_clone_extent_buffer(eb);
> >  		if (!eb_rewin) {
> > -			btrfs_tree_read_unlock(eb);
> > +			btrfs_tree_read_unlock_blocking(eb);
> >  			free_extent_buffer(eb);
> >  			return NULL;
> >  		}
> >  	}
> >  
> > -	btrfs_tree_read_unlock(eb);
> > +	btrfs_clear_path_blocking(path, NULL, BTRFS_READ_LOCK);
> > +	btrfs_tree_read_unlock_blocking(eb);
> 
> unlock_blocking? Rest looks ok to me.
> 

Yeah I change the lock to blocking above, so I have to do read_unlock_blocking
here.  Thanks,

Josef

  reply	other threads:[~2013-08-08 13:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-07 21:11 [PATCH] Btrfs: stop using GFP_ATOMIC when allocating rewind ebs Josef Bacik
2013-08-08  7:23 ` Jan Schmidt
2013-08-08 13:12   ` Josef Bacik [this message]
2013-08-08 13:19     ` Jan Schmidt
2013-08-16 11:37 ` Stefan Behrens
2013-08-16 14:05   ` Josef Bacik

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=20130808131217.GC16712@localhost.localdomain \
    --to=jbacik@fusionio.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=list.btrfs@jan-o-sch.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.