linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Brian Foster <bfoster@redhat.com>
Cc: linux-xfs@vger.kernel.org, Christoph Hellwig <hch@infradead.org>,
	Dave Chinner <david@fromorbit.com>
Subject: Re: [PATCH] xfs: factor out nodiscard helpers
Date: Thu, 10 May 2018 06:54:10 -0700	[thread overview]
Message-ID: <20180510135410.GA3074@infradead.org> (raw)
In-Reply-To: <20180510125223.77364-1-bfoster@redhat.com>

This looks much better, and I think the diffstat speaks for itself..

Reviewed-by: Christoph Hellwig <hch@lst.de>

> diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
> index 24f60ee810e4..fd3c3be4d64a 100644
> --- a/fs/xfs/libxfs/xfs_bmap.c
> +++ b/fs/xfs/libxfs/xfs_bmap.c
> @@ -5107,15 +5107,15 @@ xfs_bmap_del_extent_real(
>  			if (error)
>  				goto done;
>  		} else {
> +			bool	skip_discard = false;
> +
>  			if ((bflags & XFS_BMAPI_NODISCARD) ||
> +			    (del->br_state == XFS_EXT_UNWRITTEN))

No need for the inner braces in the second statement.

> +				skip_discard = true;
> +
> +			__xfs_bmap_add_free(mp, dfops, del->br_startblock,
> +					    del->br_blockcount, NULL,
> +					    skip_discard);

In fact I'd avoid the variable entirely:

			__xfs_bmap_add_free(mp, dfops, del->br_startblock,
					del->br_blockcount, NULL,
					del->br_state == XFS_EXT_UNWRITTEN ||
					(bflags & XFS_BMAPI_NODISCARD));


  reply	other threads:[~2018-05-10 13:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-10 12:52 [PATCH] xfs: factor out nodiscard helpers Brian Foster
2018-05-10 13:54 ` Christoph Hellwig [this message]
2018-05-10 14:07 ` [PATCH v2] " Brian Foster
2018-05-10 16:38   ` Darrick J. Wong

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=20180510135410.GA3074@infradead.org \
    --to=hch@infradead.org \
    --cc=bfoster@redhat.com \
    --cc=david@fromorbit.com \
    --cc=linux-xfs@vger.kernel.org \
    /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).