All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: Eric Sandeen <sandeen@redhat.com>, xfs-oss <xfs@oss.sgi.com>
Subject: Re: [PATCH 4/4] xfs: remove rbpp check from xfs_rtmodify_summary_int
Date: Fri, 22 Aug 2014 09:20:05 -0400	[thread overview]
Message-ID: <20140822132004.GD3915@laptop.bfoster> (raw)
In-Reply-To: <53F696D7.2030906@sandeen.net>

On Thu, Aug 21, 2014 at 08:03:19PM -0500, Eric Sandeen wrote:
> rbpp is always passed into xfs_rtmodify_summary
> and xfs_rtget_summary, so there is no need to
> test for it in xfs_rtmodify_summary_int.
> 

Looks fine, but this is also called through a variety of twisty paths.
Could we add a top-level error check or assert?

Brian

> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
> 
> diff --git a/fs/xfs/libxfs/xfs_rtbitmap.c b/fs/xfs/libxfs/xfs_rtbitmap.c
> index 50e3b93..7c818f1 100644
> --- a/fs/xfs/libxfs/xfs_rtbitmap.c
> +++ b/fs/xfs/libxfs/xfs_rtbitmap.c
> @@ -460,7 +460,7 @@ xfs_rtmodify_summary_int(
>  	/*
>  	 * If we have an old buffer, and the block number matches, use that.
>  	 */
> -	if (rbpp && *rbpp && *rsb == sb)
> +	if (*rbpp && *rsb == sb)
>  		bp = *rbpp;
>  	/*
>  	 * Otherwise we have to get the buffer.
> @@ -469,7 +469,7 @@ xfs_rtmodify_summary_int(
>  		/*
>  		 * If there was an old one, get rid of it first.
>  		 */
> -		if (rbpp && *rbpp)
> +		if (*rbpp)
>  			xfs_trans_brelse(tp, *rbpp);
>  		error = xfs_rtbuf_get(mp, tp, sb, 1, &bp);
>  		if (error) {
> @@ -478,10 +478,8 @@ xfs_rtmodify_summary_int(
>  		/*
>  		 * Remember this buffer and block for the next call.
>  		 */
> -		if (rbpp) {
> -			*rbpp = bp;
> -			*rsb = sb;
> -		}
> +		*rbpp = bp;
> +		*rsb = sb;
>  	}
>  	/*
>  	 * Point to the summary information, modify/log it, and/or copy it out.
> @@ -493,14 +491,8 @@ xfs_rtmodify_summary_int(
>  		*sp += delta;
>  		xfs_trans_log_buf(tp, bp, first, first + sizeof(*sp) - 1);
>  	}
> -	if (sum) {
> -		/*
> -		 * Drop the buffer if we're not asked to remember it.
> -		 */
> -		if (!rbpp)
> -			xfs_trans_brelse(tp, bp);
> +	if (sum)
>  		*sum = *sp;
> -	}
>  	return 0;
>  }
>  
> 
> 
> _______________________________________________
> 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:[~2014-08-22 13:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-22  0:51 [PATCH 0/4] xfs: more code refactoring Eric Sandeen
2014-08-22  0:55 ` [PATCH 1/4] xfs: check resblks before calling xfs_dir_canenter Eric Sandeen
2014-08-22 13:19   ` Brian Foster
2014-08-29  0:59   ` Christoph Hellwig
2014-08-22  0:58 ` [PATCH 2/4] xfs: combine xfs_dir_canenter into xfs_dir_createname Eric Sandeen
2014-08-22 13:19   ` Brian Foster
2014-08-29  1:00   ` Christoph Hellwig
2014-08-29  2:14   ` [PATCH 2/4 V2] " Eric Sandeen
2014-08-22  1:00 ` [PATCH 3/4] xfs: combine xfs_rtmodify_summary and xfs_rtget_summary Eric Sandeen
2014-08-22 13:19   ` Brian Foster
2014-08-22 15:01     ` Eric Sandeen
2014-08-22 15:23       ` Eric Sandeen
2014-08-22  1:03 ` [PATCH 4/4] xfs: remove rbpp check from xfs_rtmodify_summary_int Eric Sandeen
2014-08-22 13:20   ` Brian Foster [this message]
2014-08-23 23:50     ` Eric Sandeen

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=20140822132004.GD3915@laptop.bfoster \
    --to=bfoster@redhat.com \
    --cc=sandeen@redhat.com \
    --cc=sandeen@sandeen.net \
    --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 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.