linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: linux-xfs@vger.kernel.org
Subject: [PATCH 2/4] xfs: return the converted extent in __xfs_reflink_convert_cow
Date: Mon,  6 Feb 2017 08:47:36 +0100	[thread overview]
Message-ID: <20170206074738.13978-3-hch@lst.de> (raw)
In-Reply-To: <20170206074738.13978-1-hch@lst.de>

We'll need it for the direct I/O code.  Also rename the function to
xfs_reflink_convert_cow_extent to describe it a bit better.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/xfs/xfs_reflink.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/fs/xfs/xfs_reflink.c b/fs/xfs/xfs_reflink.c
index ae9ba9b6d48f..e6b8af91e9a4 100644
--- a/fs/xfs/xfs_reflink.c
+++ b/fs/xfs/xfs_reflink.c
@@ -325,24 +325,23 @@ xfs_reflink_reserve_cow(
 
 /* Convert part of an unwritten CoW extent to a real one. */
 STATIC int
-__xfs_reflink_convert_cow(
+xfs_reflink_convert_cow_extent(
 	struct xfs_inode		*ip,
 	struct xfs_bmbt_irec		*imap,
 	xfs_fileoff_t			offset_fsb,
 	xfs_filblks_t			count_fsb,
 	struct xfs_defer_ops		*dfops)
 {
-	struct xfs_bmbt_irec		irec = *imap;
 	xfs_fsblock_t			first_block;
 	int				nimaps = 1;
 
-	xfs_trim_extent(&irec, offset_fsb, count_fsb);
-	trace_xfs_reflink_convert_cow(ip, &irec);
-	if (irec.br_blockcount == 0)
+	xfs_trim_extent(imap, offset_fsb, count_fsb);
+	trace_xfs_reflink_convert_cow(ip, imap);
+	if (imap->br_blockcount == 0)
 		return 0;
-	return xfs_bmapi_write(NULL, ip, irec.br_startoff, irec.br_blockcount,
+	return xfs_bmapi_write(NULL, ip, imap->br_startoff, imap->br_blockcount,
 			XFS_BMAPI_COWFORK | XFS_BMAPI_CONVERT, &first_block,
-			0, &irec, &nimaps, dfops);
+			0, imap, &nimaps, dfops);
 }
 
 /* Convert all of the unwritten CoW extents in a file's range to real ones. */
@@ -372,7 +371,7 @@ xfs_reflink_convert_cow(
 	     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,
+		error = xfs_reflink_convert_cow_extent(ip, &got, offset_fsb,
 				end_fsb - offset_fsb, &dfops);
 		if (error)
 			break;
-- 
2.11.0


  parent reply	other threads:[~2017-02-06  7:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-06  7:47 reflink direct I/O improvements V3 Christoph Hellwig
2017-02-06  7:47 ` [PATCH 1/4] xfs: introduce xfs_aligned_fsb_count Christoph Hellwig
2017-02-06  7:47 ` Christoph Hellwig [this message]
2017-02-06  7:47 ` [PATCH 3/4] xfs: go straight to real allocations for direct I/O COW writes Christoph Hellwig
2017-02-07  1:12   ` Darrick J. Wong
2017-02-06  7:47 ` [PATCH 4/4] xfs: allocate direct I/O COW blocks in iomap_begin Christoph Hellwig
2017-02-07  1:41   ` Darrick J. Wong
2017-02-09  7:21     ` Christoph Hellwig
2017-02-09  7:53       ` Darrick J. Wong
2017-02-09  7:58         ` Christoph Hellwig
2017-02-09  8:00           ` Christoph Hellwig
2017-02-09 17:22           ` Christoph Hellwig
2017-02-06 18:41 ` reflink direct I/O improvements V3 Darrick J. Wong
2017-02-06 20:55   ` 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=20170206074738.13978-3-hch@lst.de \
    --to=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;
as well as URLs for NNTP newsgroup(s).