All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: darrick.wong@oracle.com
Cc: linux-xfs@vger.kernel.org
Subject: [PATCH 11/17] xfs: convert xfs_itruncate_extents_flags to use __xfs_bunmapi
Date: Mon, 31 Dec 2018 18:11:08 -0800	[thread overview]
Message-ID: <154630866829.15625.7130537465110165585.stgit@magnolia> (raw)
In-Reply-To: <154630859850.15625.17640302184521917854.stgit@magnolia>

From: Darrick J. Wong <darrick.wong@oracle.com>

There's no reason why we can't consume unmap_len, just use the raw
version.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/xfs/xfs_inode.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)


diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index 8341031711b2..73511b003650 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -1527,7 +1527,6 @@ xfs_itruncate_extents_flags(
 	xfs_fileoff_t		last_block;
 	xfs_filblks_t		unmap_len;
 	int			error = 0;
-	int			done = 0;
 
 	ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL));
 	ASSERT(!atomic_read(&VFS_I(ip)->i_count) ||
@@ -1558,10 +1557,10 @@ xfs_itruncate_extents_flags(
 
 	ASSERT(first_unmap_block < last_block);
 	unmap_len = last_block - first_unmap_block + 1;
-	while (!done) {
+	while (unmap_len > 0) {
 		ASSERT(tp->t_firstblock == NULLFSBLOCK);
-		error = xfs_bunmapi(tp, ip, first_unmap_block, unmap_len, flags,
-				    XFS_ITRUNC_MAX_EXTENTS, &done);
+		error = __xfs_bunmapi(tp, ip, first_unmap_block, &unmap_len,
+				flags, XFS_ITRUNC_MAX_EXTENTS);
 		if (error)
 			goto out;
 

  parent reply	other threads:[~2019-01-01  2:11 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-01  2:09 [PATCH v18 00/17] xfs: online repair support Darrick J. Wong
2019-01-01  2:10 ` [PATCH 01/17] xfs: separate inode geometry Darrick J. Wong
2019-01-01  2:10 ` [PATCH 02/17] xfs: create a big array data structure Darrick J. Wong
2019-01-01  2:10 ` [PATCH 03/17] xfs: repair free space btrees Darrick J. Wong
2019-01-01  2:10 ` [PATCH 04/17] xfs: repair inode btrees Darrick J. Wong
2019-01-01  2:10 ` [PATCH 05/17] xfs: repair refcount btrees Darrick J. Wong
2019-01-01  2:10 ` [PATCH 06/17] xfs: repair inode records Darrick J. Wong
2019-01-01  2:10 ` [PATCH 07/17] xfs: zap broken inode forks Darrick J. Wong
2019-01-01  2:10 ` [PATCH 08/17] xfs: repair inode block maps Darrick J. Wong
2019-01-01  2:10 ` [PATCH 09/17] xfs: repair damaged symlinks Darrick J. Wong
2019-01-01  2:11 ` [PATCH 10/17] xfs: create a blob array data structure Darrick J. Wong
2019-01-01  2:11 ` Darrick J. Wong [this message]
2019-01-01  2:11 ` [PATCH 12/17] xfs: remove unnecessary inode-transaction roll Darrick J. Wong
2019-01-01  2:11 ` [PATCH 13/17] xfs: create a new inode fork block unmap helper Darrick J. Wong
2019-01-01  2:11 ` [PATCH 14/17] xfs: repair extended attributes Darrick J. Wong
2019-01-01  2:11 ` [PATCH 15/17] xfs: scrub should set preen if attr leaf has holes Darrick J. Wong
2019-01-01  2:11 ` [PATCH 16/17] xfs: repair quotas Darrick J. Wong
2019-01-01  2:11 ` [PATCH 17/17] xfs: convert big array and blob array to use memfd backend 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=154630866829.15625.7130537465110165585.stgit@magnolia \
    --to=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.