public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: Christoph Hellwig <hch@lst.de>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 2/3] xfs: factor btree block freeing into a helper
Date: Thu, 14 Jan 2016 12:32:21 -0500	[thread overview]
Message-ID: <20160114173221.GB11448@bfoster.bfoster> (raw)
In-Reply-To: <1452707454-15229-3-git-send-email-hch@lst.de>

On Wed, Jan 13, 2016 at 06:50:53PM +0100, Christoph Hellwig wrote:
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  fs/xfs/libxfs/xfs_btree.c | 23 ++++++++++++++++-------
>  1 file changed, 16 insertions(+), 7 deletions(-)
> 
> diff --git a/fs/xfs/libxfs/xfs_btree.c b/fs/xfs/libxfs/xfs_btree.c
> index 3143577..77afb4a 100644
> --- a/fs/xfs/libxfs/xfs_btree.c
> +++ b/fs/xfs/libxfs/xfs_btree.c
> @@ -294,6 +294,19 @@ xfs_btree_sblock_verify_crc(
>  	return true;
>  }
>  
> +static int
> +xfs_btree_free_block(
> +	struct xfs_btree_cur	*cur,
> +	struct xfs_buf		*bp)
> +{
> +	int			error;
> +
> +	error = cur->bc_ops->free_block(cur, bp);
> +	if (!error)
> +		XFS_BTREE_STATS_INC(cur, free);
> +	return error;
> +}
> +
>  /*
>   * Delete the btree cursor.
>   */
> @@ -3282,12 +3295,11 @@ xfs_btree_kill_iroot(
>  #endif
>  	xfs_btree_copy_ptrs(cur, pp, cpp, numrecs);
>  
> -	error = cur->bc_ops->free_block(cur, cbp);
> +	error = xfs_btree_free_block(cur, cbp);
>  	if (error) {
>  		XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR);
>  		return error;
>  	}
> -	XFS_BTREE_STATS_INC(cur, free);
>  
>  	cur->bc_bufs[level - 1] = NULL;
>  	be16_add_cpu(&block->bb_level, -1);
> @@ -3320,14 +3332,12 @@ xfs_btree_kill_root(
>  	 */
>  	cur->bc_ops->set_root(cur, newroot, -1);
>  
> -	error = cur->bc_ops->free_block(cur, bp);
> +	error = xfs_btree_free_block(cur, bp);
>  	if (error) {
>  		XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR);
>  		return error;
>  	}
>  
> -	XFS_BTREE_STATS_INC(cur, free);
> -
>  	cur->bc_bufs[level] = NULL;
>  	cur->bc_ra[level] = 0;
>  	cur->bc_nlevels--;
> @@ -3833,10 +3843,9 @@ xfs_btree_delrec(
>  	}
>  
>  	/* Free the deleted block. */
> -	error = cur->bc_ops->free_block(cur, rbp);
> +	error = xfs_btree_free_block(cur, rbp);
>  	if (error)
>  		goto error0;
> -	XFS_BTREE_STATS_INC(cur, free);
>  
>  	/*
>  	 * If we joined with the left neighbor, set the buffer in the
> -- 
> 1.9.1
> 
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2016-01-14 17:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-13 17:50 a couple minor btree free_block patches Christoph Hellwig
2016-01-13 17:50 ` [PATCH 1/3] xfs: handle errors from ->free_blocks in xfs_btree_kill_iroot Christoph Hellwig
2016-01-14 17:32   ` Brian Foster
2016-01-13 17:50 ` [PATCH 2/3] xfs: factor btree block freeing into a helper Christoph Hellwig
2016-01-14 17:32   ` Brian Foster [this message]
2016-01-13 17:50 ` [PATCH 3/3] xfs: move buffer invalidation to xfs_btree_free_block Christoph Hellwig
2016-01-14 17:32   ` Brian Foster

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=20160114173221.GB11448@bfoster.bfoster \
    --to=bfoster@redhat.com \
    --cc=hch@lst.de \
    --cc=xfs@oss.sgi.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