From: Christoph Hellwig <hch@infradead.org>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH v2 7/7] xfs: mark speculative prealloc CoW fork extents unwritten
Date: Wed, 1 Feb 2017 10:36:21 -0800 [thread overview]
Message-ID: <20170201183621.GA2118@infradead.org> (raw)
In-Reply-To: <20170201023617.GM9134@birch.djwong.org>
Looks fine (and tests fine):
Reviewed-by: Christoph Hellwig <hch@lst.de>
But a few style nitpicks below:
> + struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, XFS_COW_FORK);
> + xfs_fileoff_t offset_fsb;
> + xfs_fileoff_t end_fsb;
> + xfs_extnum_t idx;
> + bool found;
> + int error;
> +
> + offset_fsb = XFS_B_TO_FSBT(mp, offset);
> + end_fsb = XFS_B_TO_FSB(mp, offset + count);
Move these into the lines with the variable declarations, please.
> + xfs_ilock(ip, XFS_ILOCK_EXCL);
> +
> + /* Convert all the extents to real from unwritten. */
> + for (found = xfs_iext_lookup_extent(ip, ifp, offset_fsb, &idx, &got);
> + found && got.br_startoff < end_fsb;
> + found = xfs_iext_get_extent(ifp, ++idx, &got)) {
> + if (got.br_state == XFS_EXT_NORM)
> + continue;
> + error = __xfs_reflink_convert_cow(ip, &got, offset_fsb,
> + end_fsb - offset_fsb, &dfops);
Move the state check into __xfs_reflink_convert_cow and rename that
to xfs_reflink_convert_cow_extent?
> @@ -389,10 +479,13 @@ xfs_reflink_allocate_cow_range(
> if (error) {
> trace_xfs_reflink_allocate_cow_range_error(ip, error,
> _RET_IP_);
> - break;
> + goto out;
> }
> }
>
> + /* Convert the CoW extents to regular. */
> + error = xfs_reflink_convert_cow(ip, offset, count);
> +out:
> return error;
No need for the goto here really, justt return the error directly.
next prev parent reply other threads:[~2017-02-01 18:36 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-31 0:23 [PATCH 0/7] xfs: random fixes Darrick J. Wong
2017-01-31 0:23 ` [PATCH 1/7] xfs: fix toctou race when locking an inode to access the data map Darrick J. Wong
2017-01-31 3:01 ` Eric Sandeen
2017-01-31 13:26 ` Christoph Hellwig
2017-01-31 19:45 ` Darrick J. Wong
2017-01-31 21:40 ` Darrick J. Wong
2017-02-01 2:34 ` [PATCH v2 " Darrick J. Wong
2017-02-01 14:48 ` Christoph Hellwig
2017-01-31 0:23 ` [PATCH 2/7] xfs: fail _dir_open when readahead fails Darrick J. Wong
2017-01-31 4:12 ` Eric Sandeen
2017-01-31 13:29 ` Christoph Hellwig
2017-01-31 0:23 ` [PATCH 3/7] xfs: filter out obviously bad btree pointers Darrick J. Wong
2017-01-31 4:39 ` Eric Sandeen
2017-01-31 20:09 ` Darrick J. Wong
2017-01-31 20:37 ` Eric Sandeen
2017-01-31 0:23 ` [PATCH 4/7] xfs: check for obviously bad level values in the bmbt root Darrick J. Wong
2017-01-31 13:31 ` Christoph Hellwig
2017-01-31 0:23 ` [PATCH 5/7] xfs: verify free block header fields Darrick J. Wong
2017-01-31 13:42 ` Christoph Hellwig
2017-01-31 0:23 ` [PATCH 6/7] xfs: allow unwritten extents in the CoW fork Darrick J. Wong
2017-02-01 2:35 ` [PATCH v2 " Darrick J. Wong
2017-02-01 18:06 ` Christoph Hellwig
2017-01-31 0:23 ` [PATCH 7/7] xfs: mark speculative prealloc CoW fork extents unwritten Darrick J. Wong
2017-01-31 13:41 ` Christoph Hellwig
2017-01-31 19:11 ` Darrick J. Wong
2017-02-01 1:28 ` Darrick J. Wong
2017-02-01 2:36 ` [PATCH v2 " Darrick J. Wong
2017-02-01 18:36 ` Christoph Hellwig [this message]
2017-02-02 15:04 ` Brian Foster
2017-02-02 17:04 ` Darrick J. Wong
2017-02-02 19:42 ` 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=20170201183621.GA2118@infradead.org \
--to=hch@infradead.org \
--cc=darrick.wong@oracle.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 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.