From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Chandan Babu R <chandan.babu@oracle.com>, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 8/8] xfs: rename the del variable in xfs_reflink_end_cow_extent
Date: Mon, 29 Apr 2024 08:33:56 -0700 [thread overview]
Message-ID: <20240429153356.GZ360919@frogsfrogsfrogs> (raw)
In-Reply-To: <20240429044917.1504566-9-hch@lst.de>
On Mon, Apr 29, 2024 at 06:49:17AM +0200, Christoph Hellwig wrote:
> del contains the new extent that we are remapping. Give it a somewhat
> less confusing name.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
That's a much better choice of name!
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
--D
> ---
> fs/xfs/xfs_reflink.c | 25 +++++++++++++------------
> 1 file changed, 13 insertions(+), 12 deletions(-)
>
> diff --git a/fs/xfs/xfs_reflink.c b/fs/xfs/xfs_reflink.c
> index e20db39d1cc46f..f4c4cd4ef72336 100644
> --- a/fs/xfs/xfs_reflink.c
> +++ b/fs/xfs/xfs_reflink.c
> @@ -784,7 +784,7 @@ xfs_reflink_end_cow_extent(
> xfs_fileoff_t end_fsb)
> {
> struct xfs_iext_cursor icur;
> - struct xfs_bmbt_irec got, del;
> + struct xfs_bmbt_irec got, remap;
> struct xfs_mount *mp = ip->i_mount;
> struct xfs_trans *tp;
> struct xfs_ifork *ifp = xfs_ifork_ptr(ip, XFS_COW_FORK);
> @@ -820,7 +820,7 @@ xfs_reflink_end_cow_extent(
> * Only remap real extents that contain data. With AIO, speculative
> * preallocations can leak into the range we are called upon, and we
> * need to skip them. Preserve @got for the eventual CoW fork
> - * deletion; from now on @del represents the mapping that we're
> + * deletion; from now on @remap represents the mapping that we're
> * actually remapping.
> */
> while (!xfs_bmap_is_written_extent(&got)) {
> @@ -830,9 +830,9 @@ xfs_reflink_end_cow_extent(
> goto out_cancel;
> }
> }
> - del = got;
> - xfs_trim_extent(&del, *offset_fsb, end_fsb - *offset_fsb);
> - trace_xfs_reflink_cow_remap_from(ip, &del);
> + remap = got;
> + xfs_trim_extent(&remap, *offset_fsb, end_fsb - *offset_fsb);
> + trace_xfs_reflink_cow_remap_from(ip, &remap);
>
> error = xfs_iext_count_ensure(tp, ip, XFS_DATA_FORK,
> XFS_IEXT_REFLINK_END_COW_CNT);
> @@ -840,23 +840,24 @@ xfs_reflink_end_cow_extent(
> goto out_cancel;
>
> /* Unmap the old data. */
> - error = xfs_reflink_unmap_old_data(&tp, ip, del.br_startoff,
> - del.br_startoff + del.br_blockcount);
> + error = xfs_reflink_unmap_old_data(&tp, ip, remap.br_startoff,
> + remap.br_startoff + remap.br_blockcount);
> if (error)
> goto out_cancel;
>
> /* Free the CoW orphan record. */
> - xfs_refcount_free_cow_extent(tp, del.br_startblock, del.br_blockcount);
> + xfs_refcount_free_cow_extent(tp, remap.br_startblock,
> + remap.br_blockcount);
>
> /* Map the new blocks into the data fork. */
> - xfs_bmap_map_extent(tp, ip, XFS_DATA_FORK, &del);
> + xfs_bmap_map_extent(tp, ip, XFS_DATA_FORK, &remap);
>
> /* Charge this new data fork mapping to the on-disk quota. */
> xfs_trans_mod_dquot_byino(tp, ip, XFS_TRANS_DQ_DELBCOUNT,
> - (long)del.br_blockcount);
> + (long)remap.br_blockcount);
>
> /* Remove the mapping from the CoW fork. */
> - xfs_bmap_del_extent_cow(ip, &icur, &got, &del);
> + xfs_bmap_del_extent_cow(ip, &icur, &got, &remap);
>
> error = xfs_trans_commit(tp);
> xfs_iunlock(ip, XFS_ILOCK_EXCL);
> @@ -864,7 +865,7 @@ xfs_reflink_end_cow_extent(
> return error;
>
> /* Update the caller about how much progress we made. */
> - *offset_fsb = del.br_startoff + del.br_blockcount;
> + *offset_fsb = remap.br_startoff + remap.br_blockcount;
> return 0;
>
> out_cancel:
> --
> 2.39.2
>
>
next prev parent reply other threads:[~2024-04-29 15:33 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-29 4:49 optimize COW end I/O remapping v2 Christoph Hellwig
2024-04-29 4:49 ` [PATCH 1/8] xfs: upgrade the extent counters in xfs_reflink_end_cow_extent later Christoph Hellwig
2024-04-29 15:26 ` Darrick J. Wong
2024-04-29 17:16 ` Christoph Hellwig
2024-04-29 4:49 ` [PATCH 2/8] xfs: remove a racy if_bytes check in xfs_reflink_end_cow_extent Christoph Hellwig
2024-04-29 15:27 ` Darrick J. Wong
2024-04-29 17:17 ` Christoph Hellwig
2024-04-29 4:49 ` [PATCH 3/8] xfs: consolidate the xfs_quota_reserve_blkres definitions Christoph Hellwig
2024-04-29 4:49 ` [PATCH 4/8] xfs: xfs_quota_unreserve_blkres can't fail Christoph Hellwig
2024-04-29 15:29 ` Darrick J. Wong
2024-04-29 4:49 ` [PATCH 5/8] xfs: simplify iext overflow checking and upgrade Christoph Hellwig
2024-04-29 15:32 ` Darrick J. Wong
2024-04-29 4:49 ` [PATCH 6/8] xfs: lift XREP_MAX_ITRUNCATE_EFIS out of the scrub code Christoph Hellwig
2024-04-29 4:49 ` [PATCH 7/8] xfs: optimize extent remapping in xfs_reflink_end_cow_extent Christoph Hellwig
2024-04-29 15:43 ` Darrick J. Wong
2024-04-30 9:38 ` Christoph Hellwig
2024-04-29 4:49 ` [PATCH 8/8] xfs: rename the del variable " Christoph Hellwig
2024-04-29 15:33 ` Darrick J. Wong [this message]
2024-04-29 17:18 ` Christoph Hellwig
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=20240429153356.GZ360919@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=chandan.babu@oracle.com \
--cc=hch@lst.de \
--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