linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 00/12] xfs: refactor incore inode walking
@ 2020-05-22  2:53 Darrick J. Wong
  2020-05-22  2:53 ` [PATCH 01/12] xfs: move eofblocks conversion function to xfs_ioctl.c Darrick J. Wong
                   ` (11 more replies)
  0 siblings, 12 replies; 29+ messages in thread
From: Darrick J. Wong @ 2020-05-22  2:53 UTC (permalink / raw)
  To: darrick.wong; +Cc: Christoph Hellwig, linux-xfs, hch

Hi all,

This series prepares the incore inode walking code used by the
eofblocks/cowblocks scanner to handle deferred inode inactivation.
First we clean up the eofblocks/cowblocks incore inode walking code to
get rid of some of the warts left by reflink development.  Next, we
rip out the many trivial wrapper functions that don't add much value.
Finally, we refactor the various helpers and predicate functions to
reduce open-coded logic.

For v4 we get rid of the "ici" prefixes and merely straighten out the
inode walk function names to "xfs_inode_walk*".

If you're going to start using this mess, you probably ought to just
pull from my git trees, which are linked below.

This is an extraordinary way to destroy everything.  Enjoy!
Comments and questions are, as always, welcome.

--D

kernel git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=incore-inode-walk
---
 fs/xfs/xfs_icache.c      |  283 +++++++++++++++++++++-------------------------
 fs/xfs/xfs_icache.h      |   51 +-------
 fs/xfs/xfs_ioctl.c       |   35 ++++++
 fs/xfs/xfs_qm_syscalls.c |   17 +--
 4 files changed, 176 insertions(+), 210 deletions(-)


^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH 01/12] xfs: move eofblocks conversion function to xfs_ioctl.c
  2020-05-22  2:53 [PATCH v4 00/12] xfs: refactor incore inode walking Darrick J. Wong
@ 2020-05-22  2:53 ` Darrick J. Wong
  2020-05-22 12:03   ` Brian Foster
  2020-05-22  2:53 ` [PATCH 02/12] xfs: replace open-coded XFS_ICI_NO_TAG Darrick J. Wong
                   ` (10 subsequent siblings)
  11 siblings, 1 reply; 29+ messages in thread
From: Darrick J. Wong @ 2020-05-22  2:53 UTC (permalink / raw)
  To: darrick.wong; +Cc: Christoph Hellwig, linux-xfs, hch

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

Move xfs_fs_eofblocks_from_user into the only file that actually uses
it, so that we don't have this function cluttering up the header file.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
 fs/xfs/xfs_icache.h |   35 -----------------------------------
 fs/xfs/xfs_ioctl.c  |   35 +++++++++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+), 35 deletions(-)


diff --git a/fs/xfs/xfs_icache.h b/fs/xfs/xfs_icache.h
index 48f1fd2bb6ad..c13bc8a3e02f 100644
--- a/fs/xfs/xfs_icache.h
+++ b/fs/xfs/xfs_icache.h
@@ -81,41 +81,6 @@ int xfs_inode_ag_iterator_tag(struct xfs_mount *mp,
 	int (*execute)(struct xfs_inode *ip, int flags, void *args),
 	int flags, void *args, int tag);
 
-static inline int
-xfs_fs_eofblocks_from_user(
-	struct xfs_fs_eofblocks		*src,
-	struct xfs_eofblocks		*dst)
-{
-	if (src->eof_version != XFS_EOFBLOCKS_VERSION)
-		return -EINVAL;
-
-	if (src->eof_flags & ~XFS_EOF_FLAGS_VALID)
-		return -EINVAL;
-
-	if (memchr_inv(&src->pad32, 0, sizeof(src->pad32)) ||
-	    memchr_inv(src->pad64, 0, sizeof(src->pad64)))
-		return -EINVAL;
-
-	dst->eof_flags = src->eof_flags;
-	dst->eof_prid = src->eof_prid;
-	dst->eof_min_file_size = src->eof_min_file_size;
-
-	dst->eof_uid = INVALID_UID;
-	if (src->eof_flags & XFS_EOF_FLAGS_UID) {
-		dst->eof_uid = make_kuid(current_user_ns(), src->eof_uid);
-		if (!uid_valid(dst->eof_uid))
-			return -EINVAL;
-	}
-
-	dst->eof_gid = INVALID_GID;
-	if (src->eof_flags & XFS_EOF_FLAGS_GID) {
-		dst->eof_gid = make_kgid(current_user_ns(), src->eof_gid);
-		if (!gid_valid(dst->eof_gid))
-			return -EINVAL;
-	}
-	return 0;
-}
-
 int xfs_icache_inode_is_allocated(struct xfs_mount *mp, struct xfs_trans *tp,
 				  xfs_ino_t ino, bool *inuse);
 
diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
index 309958186d33..6a3c675a8aeb 100644
--- a/fs/xfs/xfs_ioctl.c
+++ b/fs/xfs/xfs_ioctl.c
@@ -2082,6 +2082,41 @@ xfs_ioc_setlabel(
 	return error;
 }
 
+static inline int
+xfs_fs_eofblocks_from_user(
+	struct xfs_fs_eofblocks		*src,
+	struct xfs_eofblocks		*dst)
+{
+	if (src->eof_version != XFS_EOFBLOCKS_VERSION)
+		return -EINVAL;
+
+	if (src->eof_flags & ~XFS_EOF_FLAGS_VALID)
+		return -EINVAL;
+
+	if (memchr_inv(&src->pad32, 0, sizeof(src->pad32)) ||
+	    memchr_inv(src->pad64, 0, sizeof(src->pad64)))
+		return -EINVAL;
+
+	dst->eof_flags = src->eof_flags;
+	dst->eof_prid = src->eof_prid;
+	dst->eof_min_file_size = src->eof_min_file_size;
+
+	dst->eof_uid = INVALID_UID;
+	if (src->eof_flags & XFS_EOF_FLAGS_UID) {
+		dst->eof_uid = make_kuid(current_user_ns(), src->eof_uid);
+		if (!uid_valid(dst->eof_uid))
+			return -EINVAL;
+	}
+
+	dst->eof_gid = INVALID_GID;
+	if (src->eof_flags & XFS_EOF_FLAGS_GID) {
+		dst->eof_gid = make_kgid(current_user_ns(), src->eof_gid);
+		if (!gid_valid(dst->eof_gid))
+			return -EINVAL;
+	}
+	return 0;
+}
+
 /*
  * Note: some of the ioctl's return positive numbers as a
  * byte count indicating success, such as readlink_by_handle.


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 02/12] xfs: replace open-coded XFS_ICI_NO_TAG
  2020-05-22  2:53 [PATCH v4 00/12] xfs: refactor incore inode walking Darrick J. Wong
  2020-05-22  2:53 ` [PATCH 01/12] xfs: move eofblocks conversion function to xfs_ioctl.c Darrick J. Wong
@ 2020-05-22  2:53 ` Darrick J. Wong
  2020-05-22 12:03   ` Brian Foster
  2020-05-22  2:53 ` [PATCH 03/12] xfs: remove unused xfs_inode_ag_iterator function Darrick J. Wong
                   ` (9 subsequent siblings)
  11 siblings, 1 reply; 29+ messages in thread
From: Darrick J. Wong @ 2020-05-22  2:53 UTC (permalink / raw)
  To: darrick.wong; +Cc: Christoph Hellwig, linux-xfs, hch

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

Use XFS_ICI_NO_TAG instead of -1 when appropriate.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
 fs/xfs/xfs_icache.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)


diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
index 0ed904c2aa12..b1e2541810be 100644
--- a/fs/xfs/xfs_icache.c
+++ b/fs/xfs/xfs_icache.c
@@ -815,7 +815,7 @@ xfs_inode_ag_walk(
 
 		rcu_read_lock();
 
-		if (tag == -1)
+		if (tag == XFS_ICI_NO_TAG)
 			nr_found = radix_tree_gang_lookup(&pag->pag_ici_root,
 					(void **)batch, first_index,
 					XFS_LOOKUP_BATCH);
@@ -973,8 +973,8 @@ xfs_inode_ag_iterator_flags(
 	ag = 0;
 	while ((pag = xfs_perag_get(mp, ag))) {
 		ag = pag->pag_agno + 1;
-		error = xfs_inode_ag_walk(mp, pag, execute, flags, args, -1,
-					  iter_flags);
+		error = xfs_inode_ag_walk(mp, pag, execute, flags, args,
+				XFS_ICI_NO_TAG, iter_flags);
 		xfs_perag_put(pag);
 		if (error) {
 			last_error = error;


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 03/12] xfs: remove unused xfs_inode_ag_iterator function
  2020-05-22  2:53 [PATCH v4 00/12] xfs: refactor incore inode walking Darrick J. Wong
  2020-05-22  2:53 ` [PATCH 01/12] xfs: move eofblocks conversion function to xfs_ioctl.c Darrick J. Wong
  2020-05-22  2:53 ` [PATCH 02/12] xfs: replace open-coded XFS_ICI_NO_TAG Darrick J. Wong
@ 2020-05-22  2:53 ` Darrick J. Wong
  2020-05-22 12:03   ` Brian Foster
  2020-05-22  2:53 ` [PATCH 04/12] xfs: remove xfs_inode_ag_iterator_flags Darrick J. Wong
                   ` (8 subsequent siblings)
  11 siblings, 1 reply; 29+ messages in thread
From: Darrick J. Wong @ 2020-05-22  2:53 UTC (permalink / raw)
  To: darrick.wong; +Cc: Christoph Hellwig, linux-xfs, hch

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

Not used by anyone, so get rid of it.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
 fs/xfs/xfs_icache.c |   11 -----------
 fs/xfs/xfs_icache.h |    3 ---
 2 files changed, 14 deletions(-)


diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
index b1e2541810be..6aafb547f21a 100644
--- a/fs/xfs/xfs_icache.c
+++ b/fs/xfs/xfs_icache.c
@@ -985,17 +985,6 @@ xfs_inode_ag_iterator_flags(
 	return last_error;
 }
 
-int
-xfs_inode_ag_iterator(
-	struct xfs_mount	*mp,
-	int			(*execute)(struct xfs_inode *ip, int flags,
-					   void *args),
-	int			flags,
-	void			*args)
-{
-	return xfs_inode_ag_iterator_flags(mp, execute, flags, args, 0);
-}
-
 int
 xfs_inode_ag_iterator_tag(
 	struct xfs_mount	*mp,
diff --git a/fs/xfs/xfs_icache.h b/fs/xfs/xfs_icache.h
index c13bc8a3e02f..0556fa32074f 100644
--- a/fs/xfs/xfs_icache.h
+++ b/fs/xfs/xfs_icache.h
@@ -71,9 +71,6 @@ int xfs_inode_free_quota_cowblocks(struct xfs_inode *ip);
 void xfs_cowblocks_worker(struct work_struct *);
 void xfs_queue_cowblocks(struct xfs_mount *);
 
-int xfs_inode_ag_iterator(struct xfs_mount *mp,
-	int (*execute)(struct xfs_inode *ip, int flags, void *args),
-	int flags, void *args);
 int xfs_inode_ag_iterator_flags(struct xfs_mount *mp,
 	int (*execute)(struct xfs_inode *ip, int flags, void *args),
 	int flags, void *args, int iter_flags);


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 04/12] xfs: remove xfs_inode_ag_iterator_flags
  2020-05-22  2:53 [PATCH v4 00/12] xfs: refactor incore inode walking Darrick J. Wong
                   ` (2 preceding siblings ...)
  2020-05-22  2:53 ` [PATCH 03/12] xfs: remove unused xfs_inode_ag_iterator function Darrick J. Wong
@ 2020-05-22  2:53 ` Darrick J. Wong
  2020-05-22 12:03   ` Brian Foster
  2020-05-22  2:53 ` [PATCH 05/12] xfs: remove flags argument from xfs_inode_ag_walk Darrick J. Wong
                   ` (7 subsequent siblings)
  11 siblings, 1 reply; 29+ messages in thread
From: Darrick J. Wong @ 2020-05-22  2:53 UTC (permalink / raw)
  To: darrick.wong; +Cc: Christoph Hellwig, linux-xfs, hch

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

Combine xfs_inode_ag_iterator_flags and xfs_inode_ag_iterator_tag into a
single wrapper function since there's only one caller of the _flags
variant.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
 fs/xfs/xfs_icache.c      |   43 +++++++++++++------------------------------
 fs/xfs/xfs_icache.h      |    5 +----
 fs/xfs/xfs_qm_syscalls.c |    4 ++--
 3 files changed, 16 insertions(+), 36 deletions(-)


diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
index 6aafb547f21a..6d7f3014d547 100644
--- a/fs/xfs/xfs_icache.c
+++ b/fs/xfs/xfs_icache.c
@@ -956,38 +956,22 @@ xfs_cowblocks_worker(
 	xfs_queue_cowblocks(mp);
 }
 
-int
-xfs_inode_ag_iterator_flags(
+/* Fetch the next (possibly tagged) per-AG structure. */
+static inline struct xfs_perag *
+xfs_inode_walk_get_perag(
 	struct xfs_mount	*mp,
-	int			(*execute)(struct xfs_inode *ip, int flags,
-					   void *args),
-	int			flags,
-	void			*args,
-	int			iter_flags)
+	xfs_agnumber_t		agno,
+	int			tag)
 {
-	struct xfs_perag	*pag;
-	int			error = 0;
-	int			last_error = 0;
-	xfs_agnumber_t		ag;
-
-	ag = 0;
-	while ((pag = xfs_perag_get(mp, ag))) {
-		ag = pag->pag_agno + 1;
-		error = xfs_inode_ag_walk(mp, pag, execute, flags, args,
-				XFS_ICI_NO_TAG, iter_flags);
-		xfs_perag_put(pag);
-		if (error) {
-			last_error = error;
-			if (error == -EFSCORRUPTED)
-				break;
-		}
-	}
-	return last_error;
+	if (tag == XFS_ICI_NO_TAG)
+		return xfs_perag_get(mp, agno);
+	return xfs_perag_get_tag(mp, agno, tag);
 }
 
 int
-xfs_inode_ag_iterator_tag(
+xfs_inode_ag_iterator(
 	struct xfs_mount	*mp,
+	int			iter_flags,
 	int			(*execute)(struct xfs_inode *ip, int flags,
 					   void *args),
 	int			flags,
@@ -1000,10 +984,10 @@ xfs_inode_ag_iterator_tag(
 	xfs_agnumber_t		ag;
 
 	ag = 0;
-	while ((pag = xfs_perag_get_tag(mp, ag, tag))) {
+	while ((pag = xfs_inode_walk_get_perag(mp, ag, tag))) {
 		ag = pag->pag_agno + 1;
 		error = xfs_inode_ag_walk(mp, pag, execute, flags, args, tag,
-					  0);
+				iter_flags);
 		xfs_perag_put(pag);
 		if (error) {
 			last_error = error;
@@ -1523,8 +1507,7 @@ __xfs_icache_free_eofblocks(
 	if (eofb && (eofb->eof_flags & XFS_EOF_FLAGS_SYNC))
 		flags = SYNC_WAIT;
 
-	return xfs_inode_ag_iterator_tag(mp, execute, flags,
-					 eofb, tag);
+	return xfs_inode_ag_iterator(mp, 0, execute, flags, eofb, tag);
 }
 
 int
diff --git a/fs/xfs/xfs_icache.h b/fs/xfs/xfs_icache.h
index 0556fa32074f..2d5ab9957d9f 100644
--- a/fs/xfs/xfs_icache.h
+++ b/fs/xfs/xfs_icache.h
@@ -71,10 +71,7 @@ int xfs_inode_free_quota_cowblocks(struct xfs_inode *ip);
 void xfs_cowblocks_worker(struct work_struct *);
 void xfs_queue_cowblocks(struct xfs_mount *);
 
-int xfs_inode_ag_iterator_flags(struct xfs_mount *mp,
-	int (*execute)(struct xfs_inode *ip, int flags, void *args),
-	int flags, void *args, int iter_flags);
-int xfs_inode_ag_iterator_tag(struct xfs_mount *mp,
+int xfs_inode_ag_iterator(struct xfs_mount *mp, int iter_flags,
 	int (*execute)(struct xfs_inode *ip, int flags, void *args),
 	int flags, void *args, int tag);
 
diff --git a/fs/xfs/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c
index 5d5ac65aa1cc..a9460bdcca87 100644
--- a/fs/xfs/xfs_qm_syscalls.c
+++ b/fs/xfs/xfs_qm_syscalls.c
@@ -772,6 +772,6 @@ xfs_qm_dqrele_all_inodes(
 	uint		 flags)
 {
 	ASSERT(mp->m_quotainfo);
-	xfs_inode_ag_iterator_flags(mp, xfs_dqrele_inode, flags, NULL,
-				    XFS_AGITER_INEW_WAIT);
+	xfs_inode_ag_iterator(mp, XFS_AGITER_INEW_WAIT, xfs_dqrele_inode,
+			flags, NULL, XFS_ICI_NO_TAG);
 }


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 05/12] xfs: remove flags argument from xfs_inode_ag_walk
  2020-05-22  2:53 [PATCH v4 00/12] xfs: refactor incore inode walking Darrick J. Wong
                   ` (3 preceding siblings ...)
  2020-05-22  2:53 ` [PATCH 04/12] xfs: remove xfs_inode_ag_iterator_flags Darrick J. Wong
@ 2020-05-22  2:53 ` Darrick J. Wong
  2020-05-22  6:37   ` Christoph Hellwig
  2020-05-22 12:03   ` Brian Foster
  2020-05-22  2:54 ` [PATCH 06/12] xfs: remove __xfs_icache_free_eofblocks Darrick J. Wong
                   ` (6 subsequent siblings)
  11 siblings, 2 replies; 29+ messages in thread
From: Darrick J. Wong @ 2020-05-22  2:53 UTC (permalink / raw)
  To: darrick.wong; +Cc: linux-xfs, hch

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

The incore inode walk code passes a flags argument and a pointer from
the xfs_inode_ag_iterator caller all the way to the iteration function.
We can reduce the function complexity by passing flags through the
private pointer.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/xfs/xfs_icache.c      |   43 +++++++++++++++++--------------------------
 fs/xfs/xfs_icache.h      |    4 ++--
 fs/xfs/xfs_qm_syscalls.c |   15 ++++++++-------
 3 files changed, 27 insertions(+), 35 deletions(-)


diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
index 6d7f3014d547..53c6cc7bc02a 100644
--- a/fs/xfs/xfs_icache.c
+++ b/fs/xfs/xfs_icache.c
@@ -790,9 +790,7 @@ STATIC int
 xfs_inode_ag_walk(
 	struct xfs_mount	*mp,
 	struct xfs_perag	*pag,
-	int			(*execute)(struct xfs_inode *ip, int flags,
-					   void *args),
-	int			flags,
+	int			(*execute)(struct xfs_inode *ip, void *args),
 	void			*args,
 	int			tag,
 	int			iter_flags)
@@ -868,7 +866,7 @@ xfs_inode_ag_walk(
 			if ((iter_flags & XFS_AGITER_INEW_WAIT) &&
 			    xfs_iflags_test(batch[i], XFS_INEW))
 				xfs_inew_wait(batch[i]);
-			error = execute(batch[i], flags, args);
+			error = execute(batch[i], args);
 			xfs_irele(batch[i]);
 			if (error == -EAGAIN) {
 				skipped++;
@@ -972,9 +970,7 @@ int
 xfs_inode_ag_iterator(
 	struct xfs_mount	*mp,
 	int			iter_flags,
-	int			(*execute)(struct xfs_inode *ip, int flags,
-					   void *args),
-	int			flags,
+	int			(*execute)(struct xfs_inode *ip, void *args),
 	void			*args,
 	int			tag)
 {
@@ -986,7 +982,7 @@ xfs_inode_ag_iterator(
 	ag = 0;
 	while ((pag = xfs_inode_walk_get_perag(mp, ag, tag))) {
 		ag = pag->pag_agno + 1;
-		error = xfs_inode_ag_walk(mp, pag, execute, flags, args, tag,
+		error = xfs_inode_ag_walk(mp, pag, execute, args, tag,
 				iter_flags);
 		xfs_perag_put(pag);
 		if (error) {
@@ -1443,12 +1439,14 @@ xfs_inode_match_id_union(
 STATIC int
 xfs_inode_free_eofblocks(
 	struct xfs_inode	*ip,
-	int			flags,
 	void			*args)
 {
-	int ret = 0;
-	struct xfs_eofblocks *eofb = args;
-	int match;
+	struct xfs_eofblocks	*eofb = args;
+	bool			wait;
+	int			match;
+	int			ret;
+
+	wait = eofb && (eofb->eof_flags & XFS_EOF_FLAGS_SYNC);
 
 	if (!xfs_can_free_eofblocks(ip, false)) {
 		/* inode could be preallocated or append-only */
@@ -1461,8 +1459,7 @@ xfs_inode_free_eofblocks(
 	 * If the mapping is dirty the operation can block and wait for some
 	 * time. Unless we are waiting, skip it.
 	 */
-	if (!(flags & SYNC_WAIT) &&
-	    mapping_tagged(VFS_I(ip)->i_mapping, PAGECACHE_TAG_DIRTY))
+	if (!wait && mapping_tagged(VFS_I(ip)->i_mapping, PAGECACHE_TAG_DIRTY))
 		return 0;
 
 	if (eofb) {
@@ -1484,10 +1481,11 @@ xfs_inode_free_eofblocks(
 	 * scanner moving and revisit the inode in a subsequent pass.
 	 */
 	if (!xfs_ilock_nowait(ip, XFS_IOLOCK_EXCL)) {
-		if (flags & SYNC_WAIT)
-			ret = -EAGAIN;
-		return ret;
+		if (wait)
+			return -EAGAIN;
+		return 0;
 	}
+
 	ret = xfs_free_eofblocks(ip);
 	xfs_iunlock(ip, XFS_IOLOCK_EXCL);
 
@@ -1498,16 +1496,10 @@ static int
 __xfs_icache_free_eofblocks(
 	struct xfs_mount	*mp,
 	struct xfs_eofblocks	*eofb,
-	int			(*execute)(struct xfs_inode *ip, int flags,
-					   void *args),
+	int			(*execute)(struct xfs_inode *ip, void *args),
 	int			tag)
 {
-	int flags = SYNC_TRYLOCK;
-
-	if (eofb && (eofb->eof_flags & XFS_EOF_FLAGS_SYNC))
-		flags = SYNC_WAIT;
-
-	return xfs_inode_ag_iterator(mp, 0, execute, flags, eofb, tag);
+	return xfs_inode_ag_iterator(mp, 0, execute, eofb, tag);
 }
 
 int
@@ -1732,7 +1724,6 @@ xfs_prep_free_cowblocks(
 STATIC int
 xfs_inode_free_cowblocks(
 	struct xfs_inode	*ip,
-	int			flags,
 	void			*args)
 {
 	struct xfs_eofblocks	*eofb = args;
diff --git a/fs/xfs/xfs_icache.h b/fs/xfs/xfs_icache.h
index 2d5ab9957d9f..e7f86ebd7b22 100644
--- a/fs/xfs/xfs_icache.h
+++ b/fs/xfs/xfs_icache.h
@@ -72,8 +72,8 @@ void xfs_cowblocks_worker(struct work_struct *);
 void xfs_queue_cowblocks(struct xfs_mount *);
 
 int xfs_inode_ag_iterator(struct xfs_mount *mp, int iter_flags,
-	int (*execute)(struct xfs_inode *ip, int flags, void *args),
-	int flags, void *args, int tag);
+	int (*execute)(struct xfs_inode *ip, void *args),
+	void *args, int tag);
 
 int xfs_icache_inode_is_allocated(struct xfs_mount *mp, struct xfs_trans *tp,
 				  xfs_ino_t ino, bool *inuse);
diff --git a/fs/xfs/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c
index a9460bdcca87..4b61a683a43e 100644
--- a/fs/xfs/xfs_qm_syscalls.c
+++ b/fs/xfs/xfs_qm_syscalls.c
@@ -729,9 +729,10 @@ xfs_qm_scall_getquota_next(
 STATIC int
 xfs_dqrele_inode(
 	struct xfs_inode	*ip,
-	int			flags,
 	void			*args)
 {
+	uint			*flags = args;
+
 	/* skip quota inodes */
 	if (ip == ip->i_mount->m_quotainfo->qi_uquotaip ||
 	    ip == ip->i_mount->m_quotainfo->qi_gquotaip ||
@@ -743,15 +744,15 @@ xfs_dqrele_inode(
 	}
 
 	xfs_ilock(ip, XFS_ILOCK_EXCL);
-	if ((flags & XFS_UQUOTA_ACCT) && ip->i_udquot) {
+	if ((*flags & XFS_UQUOTA_ACCT) && ip->i_udquot) {
 		xfs_qm_dqrele(ip->i_udquot);
 		ip->i_udquot = NULL;
 	}
-	if ((flags & XFS_GQUOTA_ACCT) && ip->i_gdquot) {
+	if ((*flags & XFS_GQUOTA_ACCT) && ip->i_gdquot) {
 		xfs_qm_dqrele(ip->i_gdquot);
 		ip->i_gdquot = NULL;
 	}
-	if ((flags & XFS_PQUOTA_ACCT) && ip->i_pdquot) {
+	if ((*flags & XFS_PQUOTA_ACCT) && ip->i_pdquot) {
 		xfs_qm_dqrele(ip->i_pdquot);
 		ip->i_pdquot = NULL;
 	}
@@ -768,10 +769,10 @@ xfs_dqrele_inode(
  */
 void
 xfs_qm_dqrele_all_inodes(
-	struct xfs_mount *mp,
-	uint		 flags)
+	struct xfs_mount	*mp,
+	uint			flags)
 {
 	ASSERT(mp->m_quotainfo);
 	xfs_inode_ag_iterator(mp, XFS_AGITER_INEW_WAIT, xfs_dqrele_inode,
-			flags, NULL, XFS_ICI_NO_TAG);
+			&flags, XFS_ICI_NO_TAG);
 }


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 06/12] xfs: remove __xfs_icache_free_eofblocks
  2020-05-22  2:53 [PATCH v4 00/12] xfs: refactor incore inode walking Darrick J. Wong
                   ` (4 preceding siblings ...)
  2020-05-22  2:53 ` [PATCH 05/12] xfs: remove flags argument from xfs_inode_ag_walk Darrick J. Wong
@ 2020-05-22  2:54 ` Darrick J. Wong
  2020-05-22 12:03   ` Brian Foster
  2020-05-22  2:54 ` [PATCH 07/12] xfs: refactor eofb matching into a single helper Darrick J. Wong
                   ` (5 subsequent siblings)
  11 siblings, 1 reply; 29+ messages in thread
From: Darrick J. Wong @ 2020-05-22  2:54 UTC (permalink / raw)
  To: darrick.wong; +Cc: Christoph Hellwig, linux-xfs, hch

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

This is now a pointless wrapper, so kill it.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
 fs/xfs/xfs_icache.c |   14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)


diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
index 53c6cc7bc02a..11a5e6897639 100644
--- a/fs/xfs/xfs_icache.c
+++ b/fs/xfs/xfs_icache.c
@@ -1492,22 +1492,12 @@ xfs_inode_free_eofblocks(
 	return ret;
 }
 
-static int
-__xfs_icache_free_eofblocks(
-	struct xfs_mount	*mp,
-	struct xfs_eofblocks	*eofb,
-	int			(*execute)(struct xfs_inode *ip, void *args),
-	int			tag)
-{
-	return xfs_inode_ag_iterator(mp, 0, execute, eofb, tag);
-}
-
 int
 xfs_icache_free_eofblocks(
 	struct xfs_mount	*mp,
 	struct xfs_eofblocks	*eofb)
 {
-	return __xfs_icache_free_eofblocks(mp, eofb, xfs_inode_free_eofblocks,
+	return xfs_inode_ag_iterator(mp, 0, xfs_inode_free_eofblocks, eofb,
 			XFS_ICI_EOFBLOCKS_TAG);
 }
 
@@ -1769,7 +1759,7 @@ xfs_icache_free_cowblocks(
 	struct xfs_mount	*mp,
 	struct xfs_eofblocks	*eofb)
 {
-	return __xfs_icache_free_eofblocks(mp, eofb, xfs_inode_free_cowblocks,
+	return xfs_inode_ag_iterator(mp, 0, xfs_inode_free_cowblocks, eofb,
 			XFS_ICI_COWBLOCKS_TAG);
 }
 


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 07/12] xfs: refactor eofb matching into a single helper
  2020-05-22  2:53 [PATCH v4 00/12] xfs: refactor incore inode walking Darrick J. Wong
                   ` (5 preceding siblings ...)
  2020-05-22  2:54 ` [PATCH 06/12] xfs: remove __xfs_icache_free_eofblocks Darrick J. Wong
@ 2020-05-22  2:54 ` Darrick J. Wong
  2020-05-22  6:38   ` Christoph Hellwig
  2020-05-22 12:23   ` Brian Foster
  2020-05-22  2:54 ` [PATCH 08/12] xfs: fix inode ag walk predicate function return values Darrick J. Wong
                   ` (4 subsequent siblings)
  11 siblings, 2 replies; 29+ messages in thread
From: Darrick J. Wong @ 2020-05-22  2:54 UTC (permalink / raw)
  To: darrick.wong; +Cc: linux-xfs, hch

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

Refactor the two eofb-matching logics into a single helper so that we
don't repeat ourselves.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/xfs/xfs_icache.c |   62 ++++++++++++++++++++++++++++-----------------------
 1 file changed, 34 insertions(+), 28 deletions(-)


diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
index 11a5e6897639..3a45ec948c1a 100644
--- a/fs/xfs/xfs_icache.c
+++ b/fs/xfs/xfs_icache.c
@@ -1436,6 +1436,36 @@ xfs_inode_match_id_union(
 	return 0;
 }
 
+/*
+ * Is this inode @ip eligible for eof/cow block reclamation, given some
+ * filtering parameters @eofb?  The inode is eligible if @eofb is null or
+ * if the predicate functions match.
+ */
+static bool
+xfs_inode_matches_eofb(
+	struct xfs_inode	*ip,
+	struct xfs_eofblocks	*eofb)
+{
+	int			match;
+
+	if (!eofb)
+		return true;
+
+	if (eofb->eof_flags & XFS_EOF_FLAGS_UNION)
+		match = xfs_inode_match_id_union(ip, eofb);
+	else
+		match = xfs_inode_match_id(ip, eofb);
+	if (!match)
+		return false;
+
+	/* skip the inode if the file size is too small */
+	if ((eofb->eof_flags & XFS_EOF_FLAGS_MINFILESIZE) &&
+	    XFS_ISIZE(ip) < eofb->eof_min_file_size)
+		return false;
+
+	return true;
+}
+
 STATIC int
 xfs_inode_free_eofblocks(
 	struct xfs_inode	*ip,
@@ -1443,7 +1473,6 @@ xfs_inode_free_eofblocks(
 {
 	struct xfs_eofblocks	*eofb = args;
 	bool			wait;
-	int			match;
 	int			ret;
 
 	wait = eofb && (eofb->eof_flags & XFS_EOF_FLAGS_SYNC);
@@ -1462,19 +1491,8 @@ xfs_inode_free_eofblocks(
 	if (!wait && mapping_tagged(VFS_I(ip)->i_mapping, PAGECACHE_TAG_DIRTY))
 		return 0;
 
-	if (eofb) {
-		if (eofb->eof_flags & XFS_EOF_FLAGS_UNION)
-			match = xfs_inode_match_id_union(ip, eofb);
-		else
-			match = xfs_inode_match_id(ip, eofb);
-		if (!match)
-			return 0;
-
-		/* skip the inode if the file size is too small */
-		if (eofb->eof_flags & XFS_EOF_FLAGS_MINFILESIZE &&
-		    XFS_ISIZE(ip) < eofb->eof_min_file_size)
-			return 0;
-	}
+	if (!xfs_inode_matches_eofb(ip, eofb))
+		return 0;
 
 	/*
 	 * If the caller is waiting, return -EAGAIN to keep the background
@@ -1717,25 +1735,13 @@ xfs_inode_free_cowblocks(
 	void			*args)
 {
 	struct xfs_eofblocks	*eofb = args;
-	int			match;
 	int			ret = 0;
 
 	if (!xfs_prep_free_cowblocks(ip))
 		return 0;
 
-	if (eofb) {
-		if (eofb->eof_flags & XFS_EOF_FLAGS_UNION)
-			match = xfs_inode_match_id_union(ip, eofb);
-		else
-			match = xfs_inode_match_id(ip, eofb);
-		if (!match)
-			return 0;
-
-		/* skip the inode if the file size is too small */
-		if (eofb->eof_flags & XFS_EOF_FLAGS_MINFILESIZE &&
-		    XFS_ISIZE(ip) < eofb->eof_min_file_size)
-			return 0;
-	}
+	if (!xfs_inode_matches_eofb(ip, eofb))
+		return 0;
 
 	/* Free the CoW blocks */
 	xfs_ilock(ip, XFS_IOLOCK_EXCL);


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 08/12] xfs: fix inode ag walk predicate function return values
  2020-05-22  2:53 [PATCH v4 00/12] xfs: refactor incore inode walking Darrick J. Wong
                   ` (6 preceding siblings ...)
  2020-05-22  2:54 ` [PATCH 07/12] xfs: refactor eofb matching into a single helper Darrick J. Wong
@ 2020-05-22  2:54 ` Darrick J. Wong
  2020-05-22 12:23   ` Brian Foster
  2020-05-22  2:54 ` [PATCH 09/12] xfs: use bool for done in xfs_inode_ag_walk Darrick J. Wong
                   ` (3 subsequent siblings)
  11 siblings, 1 reply; 29+ messages in thread
From: Darrick J. Wong @ 2020-05-22  2:54 UTC (permalink / raw)
  To: darrick.wong; +Cc: Christoph Hellwig, linux-xfs, hch

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

There are a number of predicate functions that help the incore inode
walking code decide if we really want to apply the iteration function to
the inode.  These are boolean decisions, so change the return types to
boolean to match.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
 fs/xfs/xfs_icache.c |   39 ++++++++++++++++++++++-----------------
 1 file changed, 22 insertions(+), 17 deletions(-)


diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
index 3a45ec948c1a..31d85cc4bd8b 100644
--- a/fs/xfs/xfs_icache.c
+++ b/fs/xfs/xfs_icache.c
@@ -741,7 +741,12 @@ xfs_icache_inode_is_allocated(
  */
 #define XFS_LOOKUP_BATCH	32
 
-STATIC int
+/*
+ * Decide if the given @ip is eligible to be a part of the inode walk, and
+ * grab it if so.  Returns true if it's ready to go or false if we should just
+ * ignore it.
+ */
+STATIC bool
 xfs_inode_ag_walk_grab(
 	struct xfs_inode	*ip,
 	int			flags)
@@ -772,18 +777,18 @@ xfs_inode_ag_walk_grab(
 
 	/* nothing to sync during shutdown */
 	if (XFS_FORCED_SHUTDOWN(ip->i_mount))
-		return -EFSCORRUPTED;
+		return false;
 
 	/* If we can't grab the inode, it must on it's way to reclaim. */
 	if (!igrab(inode))
-		return -ENOENT;
+		return false;
 
 	/* inode is valid */
-	return 0;
+	return true;
 
 out_unlock_noent:
 	spin_unlock(&ip->i_flags_lock);
-	return -ENOENT;
+	return false;
 }
 
 STATIC int
@@ -835,7 +840,7 @@ xfs_inode_ag_walk(
 		for (i = 0; i < nr_found; i++) {
 			struct xfs_inode *ip = batch[i];
 
-			if (done || xfs_inode_ag_walk_grab(ip, iter_flags))
+			if (done || !xfs_inode_ag_walk_grab(ip, iter_flags))
 				batch[i] = NULL;
 
 			/*
@@ -1392,48 +1397,48 @@ xfs_reclaim_inodes_count(
 	return reclaimable;
 }
 
-STATIC int
+STATIC bool
 xfs_inode_match_id(
 	struct xfs_inode	*ip,
 	struct xfs_eofblocks	*eofb)
 {
 	if ((eofb->eof_flags & XFS_EOF_FLAGS_UID) &&
 	    !uid_eq(VFS_I(ip)->i_uid, eofb->eof_uid))
-		return 0;
+		return false;
 
 	if ((eofb->eof_flags & XFS_EOF_FLAGS_GID) &&
 	    !gid_eq(VFS_I(ip)->i_gid, eofb->eof_gid))
-		return 0;
+		return false;
 
 	if ((eofb->eof_flags & XFS_EOF_FLAGS_PRID) &&
 	    ip->i_d.di_projid != eofb->eof_prid)
-		return 0;
+		return false;
 
-	return 1;
+	return true;
 }
 
 /*
  * A union-based inode filtering algorithm. Process the inode if any of the
  * criteria match. This is for global/internal scans only.
  */
-STATIC int
+STATIC bool
 xfs_inode_match_id_union(
 	struct xfs_inode	*ip,
 	struct xfs_eofblocks	*eofb)
 {
 	if ((eofb->eof_flags & XFS_EOF_FLAGS_UID) &&
 	    uid_eq(VFS_I(ip)->i_uid, eofb->eof_uid))
-		return 1;
+		return true;
 
 	if ((eofb->eof_flags & XFS_EOF_FLAGS_GID) &&
 	    gid_eq(VFS_I(ip)->i_gid, eofb->eof_gid))
-		return 1;
+		return true;
 
 	if ((eofb->eof_flags & XFS_EOF_FLAGS_PRID) &&
 	    ip->i_d.di_projid == eofb->eof_prid)
-		return 1;
+		return true;
 
-	return 0;
+	return false;
 }
 
 /*
@@ -1446,7 +1451,7 @@ xfs_inode_matches_eofb(
 	struct xfs_inode	*ip,
 	struct xfs_eofblocks	*eofb)
 {
-	int			match;
+	bool			match;
 
 	if (!eofb)
 		return true;


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 09/12] xfs: use bool for done in xfs_inode_ag_walk
  2020-05-22  2:53 [PATCH v4 00/12] xfs: refactor incore inode walking Darrick J. Wong
                   ` (7 preceding siblings ...)
  2020-05-22  2:54 ` [PATCH 08/12] xfs: fix inode ag walk predicate function return values Darrick J. Wong
@ 2020-05-22  2:54 ` Darrick J. Wong
  2020-05-22 12:23   ` Brian Foster
  2020-05-22  2:54 ` [PATCH 10/12] xfs: move xfs_inode_ag_iterator to be closer to the perag walking code Darrick J. Wong
                   ` (2 subsequent siblings)
  11 siblings, 1 reply; 29+ messages in thread
From: Darrick J. Wong @ 2020-05-22  2:54 UTC (permalink / raw)
  To: darrick.wong; +Cc: Christoph Hellwig, linux-xfs, hch

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

This is a boolean variable, so use the bool type.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
 fs/xfs/xfs_icache.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)


diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
index 31d85cc4bd8b..791544a1d54c 100644
--- a/fs/xfs/xfs_icache.c
+++ b/fs/xfs/xfs_icache.c
@@ -803,11 +803,11 @@ xfs_inode_ag_walk(
 	uint32_t		first_index;
 	int			last_error = 0;
 	int			skipped;
-	int			done;
+	bool			done;
 	int			nr_found;
 
 restart:
-	done = 0;
+	done = false;
 	skipped = 0;
 	first_index = 0;
 	nr_found = 0;
@@ -859,7 +859,7 @@ xfs_inode_ag_walk(
 				continue;
 			first_index = XFS_INO_TO_AGINO(mp, ip->i_ino + 1);
 			if (first_index < XFS_INO_TO_AGINO(mp, ip->i_ino))
-				done = 1;
+				done = true;
 		}
 
 		/* unlock now we've grabbed the inodes. */


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 10/12] xfs: move xfs_inode_ag_iterator to be closer to the perag walking code
  2020-05-22  2:53 [PATCH v4 00/12] xfs: refactor incore inode walking Darrick J. Wong
                   ` (8 preceding siblings ...)
  2020-05-22  2:54 ` [PATCH 09/12] xfs: use bool for done in xfs_inode_ag_walk Darrick J. Wong
@ 2020-05-22  2:54 ` Darrick J. Wong
  2020-05-22 12:23   ` Brian Foster
  2020-05-22  2:54 ` [PATCH 11/12] xfs: straighten out all the naming around incore inode tree walks Darrick J. Wong
  2020-05-22  2:54 ` [PATCH 12/12] xfs: rearrange xfs_inode_walk_ag parameters Darrick J. Wong
  11 siblings, 1 reply; 29+ messages in thread
From: Darrick J. Wong @ 2020-05-22  2:54 UTC (permalink / raw)
  To: darrick.wong; +Cc: Christoph Hellwig, linux-xfs, hch

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

Move the xfs_inode_ag_iterator function to be nearer xfs_inode_ag_walk
so that we don't have to scroll back and forth to figure out how the
incore inode walking function works.  No functional changes.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
 fs/xfs/xfs_icache.c |   88 ++++++++++++++++++++++++++++-----------------------
 1 file changed, 48 insertions(+), 40 deletions(-)


diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
index 791544a1d54c..0e25d50372e2 100644
--- a/fs/xfs/xfs_icache.c
+++ b/fs/xfs/xfs_icache.c
@@ -791,6 +791,10 @@ xfs_inode_ag_walk_grab(
 	return false;
 }
 
+/*
+ * For a given per-AG structure @pag, grab, @execute, and rele all incore
+ * inodes with the given radix tree @tag.
+ */
 STATIC int
 xfs_inode_ag_walk(
 	struct xfs_mount	*mp,
@@ -896,6 +900,50 @@ xfs_inode_ag_walk(
 	return last_error;
 }
 
+/* Fetch the next (possibly tagged) per-AG structure. */
+static inline struct xfs_perag *
+xfs_inode_walk_get_perag(
+	struct xfs_mount	*mp,
+	xfs_agnumber_t		agno,
+	int			tag)
+{
+	if (tag == XFS_ICI_NO_TAG)
+		return xfs_perag_get(mp, agno);
+	return xfs_perag_get_tag(mp, agno, tag);
+}
+
+/*
+ * Call the @execute function on all incore inodes matching the radix tree
+ * @tag.
+ */
+int
+xfs_inode_ag_iterator(
+	struct xfs_mount	*mp,
+	int			iter_flags,
+	int			(*execute)(struct xfs_inode *ip, void *args),
+	void			*args,
+	int			tag)
+{
+	struct xfs_perag	*pag;
+	int			error = 0;
+	int			last_error = 0;
+	xfs_agnumber_t		ag;
+
+	ag = 0;
+	while ((pag = xfs_inode_walk_get_perag(mp, ag, tag))) {
+		ag = pag->pag_agno + 1;
+		error = xfs_inode_ag_walk(mp, pag, execute, args, tag,
+				iter_flags);
+		xfs_perag_put(pag);
+		if (error) {
+			last_error = error;
+			if (error == -EFSCORRUPTED)
+				break;
+		}
+	}
+	return last_error;
+}
+
 /*
  * Background scanning to trim post-EOF preallocated space. This is queued
  * based on the 'speculative_prealloc_lifetime' tunable (5m by default).
@@ -959,46 +1007,6 @@ xfs_cowblocks_worker(
 	xfs_queue_cowblocks(mp);
 }
 
-/* Fetch the next (possibly tagged) per-AG structure. */
-static inline struct xfs_perag *
-xfs_inode_walk_get_perag(
-	struct xfs_mount	*mp,
-	xfs_agnumber_t		agno,
-	int			tag)
-{
-	if (tag == XFS_ICI_NO_TAG)
-		return xfs_perag_get(mp, agno);
-	return xfs_perag_get_tag(mp, agno, tag);
-}
-
-int
-xfs_inode_ag_iterator(
-	struct xfs_mount	*mp,
-	int			iter_flags,
-	int			(*execute)(struct xfs_inode *ip, void *args),
-	void			*args,
-	int			tag)
-{
-	struct xfs_perag	*pag;
-	int			error = 0;
-	int			last_error = 0;
-	xfs_agnumber_t		ag;
-
-	ag = 0;
-	while ((pag = xfs_inode_walk_get_perag(mp, ag, tag))) {
-		ag = pag->pag_agno + 1;
-		error = xfs_inode_ag_walk(mp, pag, execute, args, tag,
-				iter_flags);
-		xfs_perag_put(pag);
-		if (error) {
-			last_error = error;
-			if (error == -EFSCORRUPTED)
-				break;
-		}
-	}
-	return last_error;
-}
-
 /*
  * Grab the inode for reclaim exclusively.
  * Return 0 if we grabbed it, non-zero otherwise.


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 11/12] xfs: straighten out all the naming around incore inode tree walks
  2020-05-22  2:53 [PATCH v4 00/12] xfs: refactor incore inode walking Darrick J. Wong
                   ` (9 preceding siblings ...)
  2020-05-22  2:54 ` [PATCH 10/12] xfs: move xfs_inode_ag_iterator to be closer to the perag walking code Darrick J. Wong
@ 2020-05-22  2:54 ` Darrick J. Wong
  2020-05-22  6:38   ` Christoph Hellwig
  2020-05-22 12:23   ` Brian Foster
  2020-05-22  2:54 ` [PATCH 12/12] xfs: rearrange xfs_inode_walk_ag parameters Darrick J. Wong
  11 siblings, 2 replies; 29+ messages in thread
From: Darrick J. Wong @ 2020-05-22  2:54 UTC (permalink / raw)
  To: darrick.wong; +Cc: linux-xfs, hch

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

We're not very consistent about function names for the incore inode
iteration function.  Turn them all into xfs_inode_walk* variants.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/xfs/xfs_icache.c      |   18 +++++++++---------
 fs/xfs/xfs_icache.h      |    6 +++---
 fs/xfs/xfs_qm_syscalls.c |    2 +-
 3 files changed, 13 insertions(+), 13 deletions(-)


diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
index 0e25d50372e2..baf59087caa5 100644
--- a/fs/xfs/xfs_icache.c
+++ b/fs/xfs/xfs_icache.c
@@ -747,12 +747,12 @@ xfs_icache_inode_is_allocated(
  * ignore it.
  */
 STATIC bool
-xfs_inode_ag_walk_grab(
+xfs_inode_walk_ag_grab(
 	struct xfs_inode	*ip,
 	int			flags)
 {
 	struct inode		*inode = VFS_I(ip);
-	bool			newinos = !!(flags & XFS_AGITER_INEW_WAIT);
+	bool			newinos = !!(flags & XFS_INODE_WALK_INEW_WAIT);
 
 	ASSERT(rcu_read_lock_held());
 
@@ -796,7 +796,7 @@ xfs_inode_ag_walk_grab(
  * inodes with the given radix tree @tag.
  */
 STATIC int
-xfs_inode_ag_walk(
+xfs_inode_walk_ag(
 	struct xfs_mount	*mp,
 	struct xfs_perag	*pag,
 	int			(*execute)(struct xfs_inode *ip, void *args),
@@ -844,7 +844,7 @@ xfs_inode_ag_walk(
 		for (i = 0; i < nr_found; i++) {
 			struct xfs_inode *ip = batch[i];
 
-			if (done || !xfs_inode_ag_walk_grab(ip, iter_flags))
+			if (done || !xfs_inode_walk_ag_grab(ip, iter_flags))
 				batch[i] = NULL;
 
 			/*
@@ -872,7 +872,7 @@ xfs_inode_ag_walk(
 		for (i = 0; i < nr_found; i++) {
 			if (!batch[i])
 				continue;
-			if ((iter_flags & XFS_AGITER_INEW_WAIT) &&
+			if ((iter_flags & XFS_INODE_WALK_INEW_WAIT) &&
 			    xfs_iflags_test(batch[i], XFS_INEW))
 				xfs_inew_wait(batch[i]);
 			error = execute(batch[i], args);
@@ -917,7 +917,7 @@ xfs_inode_walk_get_perag(
  * @tag.
  */
 int
-xfs_inode_ag_iterator(
+xfs_inode_walk(
 	struct xfs_mount	*mp,
 	int			iter_flags,
 	int			(*execute)(struct xfs_inode *ip, void *args),
@@ -932,7 +932,7 @@ xfs_inode_ag_iterator(
 	ag = 0;
 	while ((pag = xfs_inode_walk_get_perag(mp, ag, tag))) {
 		ag = pag->pag_agno + 1;
-		error = xfs_inode_ag_walk(mp, pag, execute, args, tag,
+		error = xfs_inode_walk_ag(mp, pag, execute, args, tag,
 				iter_flags);
 		xfs_perag_put(pag);
 		if (error) {
@@ -1528,7 +1528,7 @@ xfs_icache_free_eofblocks(
 	struct xfs_mount	*mp,
 	struct xfs_eofblocks	*eofb)
 {
-	return xfs_inode_ag_iterator(mp, 0, xfs_inode_free_eofblocks, eofb,
+	return xfs_inode_walk(mp, 0, xfs_inode_free_eofblocks, eofb,
 			XFS_ICI_EOFBLOCKS_TAG);
 }
 
@@ -1778,7 +1778,7 @@ xfs_icache_free_cowblocks(
 	struct xfs_mount	*mp,
 	struct xfs_eofblocks	*eofb)
 {
-	return xfs_inode_ag_iterator(mp, 0, xfs_inode_free_cowblocks, eofb,
+	return xfs_inode_walk(mp, 0, xfs_inode_free_cowblocks, eofb,
 			XFS_ICI_COWBLOCKS_TAG);
 }
 
diff --git a/fs/xfs/xfs_icache.h b/fs/xfs/xfs_icache.h
index e7f86ebd7b22..93b54e7d55f0 100644
--- a/fs/xfs/xfs_icache.h
+++ b/fs/xfs/xfs_icache.h
@@ -24,7 +24,7 @@ struct xfs_eofblocks {
  * tags for inode radix tree
  */
 #define XFS_ICI_NO_TAG		(-1)	/* special flag for an untagged lookup
-					   in xfs_inode_ag_iterator */
+					   in xfs_inode_walk */
 #define XFS_ICI_RECLAIM_TAG	0	/* inode is to be reclaimed */
 #define XFS_ICI_EOFBLOCKS_TAG	1	/* inode has blocks beyond EOF */
 #define XFS_ICI_COWBLOCKS_TAG	2	/* inode can have cow blocks to gc */
@@ -40,7 +40,7 @@ struct xfs_eofblocks {
 /*
  * flags for AG inode iterator
  */
-#define XFS_AGITER_INEW_WAIT	0x1	/* wait on new inodes */
+#define XFS_INODE_WALK_INEW_WAIT	0x1	/* wait on new inodes */
 
 int xfs_iget(struct xfs_mount *mp, struct xfs_trans *tp, xfs_ino_t ino,
 	     uint flags, uint lock_flags, xfs_inode_t **ipp);
@@ -71,7 +71,7 @@ int xfs_inode_free_quota_cowblocks(struct xfs_inode *ip);
 void xfs_cowblocks_worker(struct work_struct *);
 void xfs_queue_cowblocks(struct xfs_mount *);
 
-int xfs_inode_ag_iterator(struct xfs_mount *mp, int iter_flags,
+int xfs_inode_walk(struct xfs_mount *mp, int iter_flags,
 	int (*execute)(struct xfs_inode *ip, void *args),
 	void *args, int tag);
 
diff --git a/fs/xfs/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c
index 4b61a683a43e..e8b63af93eb5 100644
--- a/fs/xfs/xfs_qm_syscalls.c
+++ b/fs/xfs/xfs_qm_syscalls.c
@@ -773,6 +773,6 @@ xfs_qm_dqrele_all_inodes(
 	uint			flags)
 {
 	ASSERT(mp->m_quotainfo);
-	xfs_inode_ag_iterator(mp, XFS_AGITER_INEW_WAIT, xfs_dqrele_inode,
+	xfs_inode_walk(mp, XFS_INODE_WALK_INEW_WAIT, xfs_dqrele_inode,
 			&flags, XFS_ICI_NO_TAG);
 }


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 12/12] xfs: rearrange xfs_inode_walk_ag parameters
  2020-05-22  2:53 [PATCH v4 00/12] xfs: refactor incore inode walking Darrick J. Wong
                   ` (10 preceding siblings ...)
  2020-05-22  2:54 ` [PATCH 11/12] xfs: straighten out all the naming around incore inode tree walks Darrick J. Wong
@ 2020-05-22  2:54 ` Darrick J. Wong
  2020-05-22  6:39   ` Christoph Hellwig
  2020-05-22 12:23   ` Brian Foster
  11 siblings, 2 replies; 29+ messages in thread
From: Darrick J. Wong @ 2020-05-22  2:54 UTC (permalink / raw)
  To: darrick.wong; +Cc: linux-xfs, hch

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

The perag structure already has a pointer to the xfs_mount, so we don't
need to pass that separately and can drop it.  Having done that, move
iter_flags so that the argument order is the same between xfs_inode_walk
and xfs_inode_walk_ag.  The latter will make things less confusing for a
future patch that enables background scanning work to be done in
parallel.

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


diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
index baf59087caa5..fbd77467bb4d 100644
--- a/fs/xfs/xfs_icache.c
+++ b/fs/xfs/xfs_icache.c
@@ -797,13 +797,13 @@ xfs_inode_walk_ag_grab(
  */
 STATIC int
 xfs_inode_walk_ag(
-	struct xfs_mount	*mp,
 	struct xfs_perag	*pag,
+	int			iter_flags,
 	int			(*execute)(struct xfs_inode *ip, void *args),
 	void			*args,
-	int			tag,
-	int			iter_flags)
+	int			tag)
 {
+	struct xfs_mount	*mp = pag->pag_mount;
 	uint32_t		first_index;
 	int			last_error = 0;
 	int			skipped;
@@ -932,8 +932,7 @@ xfs_inode_walk(
 	ag = 0;
 	while ((pag = xfs_inode_walk_get_perag(mp, ag, tag))) {
 		ag = pag->pag_agno + 1;
-		error = xfs_inode_walk_ag(mp, pag, execute, args, tag,
-				iter_flags);
+		error = xfs_inode_walk_ag(pag, iter_flags, execute, args, tag);
 		xfs_perag_put(pag);
 		if (error) {
 			last_error = error;


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* Re: [PATCH 05/12] xfs: remove flags argument from xfs_inode_ag_walk
  2020-05-22  2:53 ` [PATCH 05/12] xfs: remove flags argument from xfs_inode_ag_walk Darrick J. Wong
@ 2020-05-22  6:37   ` Christoph Hellwig
  2020-05-22 12:03   ` Brian Foster
  1 sibling, 0 replies; 29+ messages in thread
From: Christoph Hellwig @ 2020-05-22  6:37 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-xfs, hch

On Thu, May 21, 2020 at 07:53:59PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> The incore inode walk code passes a flags argument and a pointer from
> the xfs_inode_ag_iterator caller all the way to the iteration function.
> We can reduce the function complexity by passing flags through the
> private pointer.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Looks good,

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

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 07/12] xfs: refactor eofb matching into a single helper
  2020-05-22  2:54 ` [PATCH 07/12] xfs: refactor eofb matching into a single helper Darrick J. Wong
@ 2020-05-22  6:38   ` Christoph Hellwig
  2020-05-22 12:23   ` Brian Foster
  1 sibling, 0 replies; 29+ messages in thread
From: Christoph Hellwig @ 2020-05-22  6:38 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-xfs, hch

On Thu, May 21, 2020 at 07:54:12PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Refactor the two eofb-matching logics into a single helper so that we
> don't repeat ourselves.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Looks good,

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

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 11/12] xfs: straighten out all the naming around incore inode tree walks
  2020-05-22  2:54 ` [PATCH 11/12] xfs: straighten out all the naming around incore inode tree walks Darrick J. Wong
@ 2020-05-22  6:38   ` Christoph Hellwig
  2020-05-22 12:23   ` Brian Foster
  1 sibling, 0 replies; 29+ messages in thread
From: Christoph Hellwig @ 2020-05-22  6:38 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-xfs, hch

On Thu, May 21, 2020 at 07:54:38PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> We're not very consistent about function names for the incore inode
> iteration function.  Turn them all into xfs_inode_walk* variants.

Looks ok, not that I had an issue with the previous names..

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

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 12/12] xfs: rearrange xfs_inode_walk_ag parameters
  2020-05-22  2:54 ` [PATCH 12/12] xfs: rearrange xfs_inode_walk_ag parameters Darrick J. Wong
@ 2020-05-22  6:39   ` Christoph Hellwig
  2020-05-22 12:23   ` Brian Foster
  1 sibling, 0 replies; 29+ messages in thread
From: Christoph Hellwig @ 2020-05-22  6:39 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-xfs, hch

On Thu, May 21, 2020 at 07:54:45PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> The perag structure already has a pointer to the xfs_mount, so we don't
> need to pass that separately and can drop it.  Having done that, move
> iter_flags so that the argument order is the same between xfs_inode_walk
> and xfs_inode_walk_ag.  The latter will make things less confusing for a
> future patch that enables background scanning work to be done in
> parallel.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Looks good,

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

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 01/12] xfs: move eofblocks conversion function to xfs_ioctl.c
  2020-05-22  2:53 ` [PATCH 01/12] xfs: move eofblocks conversion function to xfs_ioctl.c Darrick J. Wong
@ 2020-05-22 12:03   ` Brian Foster
  0 siblings, 0 replies; 29+ messages in thread
From: Brian Foster @ 2020-05-22 12:03 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Christoph Hellwig, linux-xfs

On Thu, May 21, 2020 at 07:53:32PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Move xfs_fs_eofblocks_from_user into the only file that actually uses
> it, so that we don't have this function cluttering up the header file.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  fs/xfs/xfs_icache.h |   35 -----------------------------------
>  fs/xfs/xfs_ioctl.c  |   35 +++++++++++++++++++++++++++++++++++
>  2 files changed, 35 insertions(+), 35 deletions(-)
> 
> 
> diff --git a/fs/xfs/xfs_icache.h b/fs/xfs/xfs_icache.h
> index 48f1fd2bb6ad..c13bc8a3e02f 100644
> --- a/fs/xfs/xfs_icache.h
> +++ b/fs/xfs/xfs_icache.h
> @@ -81,41 +81,6 @@ int xfs_inode_ag_iterator_tag(struct xfs_mount *mp,
>  	int (*execute)(struct xfs_inode *ip, int flags, void *args),
>  	int flags, void *args, int tag);
>  
> -static inline int
> -xfs_fs_eofblocks_from_user(
> -	struct xfs_fs_eofblocks		*src,
> -	struct xfs_eofblocks		*dst)
> -{
> -	if (src->eof_version != XFS_EOFBLOCKS_VERSION)
> -		return -EINVAL;
> -
> -	if (src->eof_flags & ~XFS_EOF_FLAGS_VALID)
> -		return -EINVAL;
> -
> -	if (memchr_inv(&src->pad32, 0, sizeof(src->pad32)) ||
> -	    memchr_inv(src->pad64, 0, sizeof(src->pad64)))
> -		return -EINVAL;
> -
> -	dst->eof_flags = src->eof_flags;
> -	dst->eof_prid = src->eof_prid;
> -	dst->eof_min_file_size = src->eof_min_file_size;
> -
> -	dst->eof_uid = INVALID_UID;
> -	if (src->eof_flags & XFS_EOF_FLAGS_UID) {
> -		dst->eof_uid = make_kuid(current_user_ns(), src->eof_uid);
> -		if (!uid_valid(dst->eof_uid))
> -			return -EINVAL;
> -	}
> -
> -	dst->eof_gid = INVALID_GID;
> -	if (src->eof_flags & XFS_EOF_FLAGS_GID) {
> -		dst->eof_gid = make_kgid(current_user_ns(), src->eof_gid);
> -		if (!gid_valid(dst->eof_gid))
> -			return -EINVAL;
> -	}
> -	return 0;
> -}
> -
>  int xfs_icache_inode_is_allocated(struct xfs_mount *mp, struct xfs_trans *tp,
>  				  xfs_ino_t ino, bool *inuse);
>  
> diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
> index 309958186d33..6a3c675a8aeb 100644
> --- a/fs/xfs/xfs_ioctl.c
> +++ b/fs/xfs/xfs_ioctl.c
> @@ -2082,6 +2082,41 @@ xfs_ioc_setlabel(
>  	return error;
>  }
>  
> +static inline int
> +xfs_fs_eofblocks_from_user(
> +	struct xfs_fs_eofblocks		*src,
> +	struct xfs_eofblocks		*dst)
> +{
> +	if (src->eof_version != XFS_EOFBLOCKS_VERSION)
> +		return -EINVAL;
> +
> +	if (src->eof_flags & ~XFS_EOF_FLAGS_VALID)
> +		return -EINVAL;
> +
> +	if (memchr_inv(&src->pad32, 0, sizeof(src->pad32)) ||
> +	    memchr_inv(src->pad64, 0, sizeof(src->pad64)))
> +		return -EINVAL;
> +
> +	dst->eof_flags = src->eof_flags;
> +	dst->eof_prid = src->eof_prid;
> +	dst->eof_min_file_size = src->eof_min_file_size;
> +
> +	dst->eof_uid = INVALID_UID;
> +	if (src->eof_flags & XFS_EOF_FLAGS_UID) {
> +		dst->eof_uid = make_kuid(current_user_ns(), src->eof_uid);
> +		if (!uid_valid(dst->eof_uid))
> +			return -EINVAL;
> +	}
> +
> +	dst->eof_gid = INVALID_GID;
> +	if (src->eof_flags & XFS_EOF_FLAGS_GID) {
> +		dst->eof_gid = make_kgid(current_user_ns(), src->eof_gid);
> +		if (!gid_valid(dst->eof_gid))
> +			return -EINVAL;
> +	}
> +	return 0;
> +}
> +
>  /*
>   * Note: some of the ioctl's return positive numbers as a
>   * byte count indicating success, such as readlink_by_handle.
> 


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 02/12] xfs: replace open-coded XFS_ICI_NO_TAG
  2020-05-22  2:53 ` [PATCH 02/12] xfs: replace open-coded XFS_ICI_NO_TAG Darrick J. Wong
@ 2020-05-22 12:03   ` Brian Foster
  0 siblings, 0 replies; 29+ messages in thread
From: Brian Foster @ 2020-05-22 12:03 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Christoph Hellwig, linux-xfs

On Thu, May 21, 2020 at 07:53:40PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Use XFS_ICI_NO_TAG instead of -1 when appropriate.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  fs/xfs/xfs_icache.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> 
> diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
> index 0ed904c2aa12..b1e2541810be 100644
> --- a/fs/xfs/xfs_icache.c
> +++ b/fs/xfs/xfs_icache.c
> @@ -815,7 +815,7 @@ xfs_inode_ag_walk(
>  
>  		rcu_read_lock();
>  
> -		if (tag == -1)
> +		if (tag == XFS_ICI_NO_TAG)
>  			nr_found = radix_tree_gang_lookup(&pag->pag_ici_root,
>  					(void **)batch, first_index,
>  					XFS_LOOKUP_BATCH);
> @@ -973,8 +973,8 @@ xfs_inode_ag_iterator_flags(
>  	ag = 0;
>  	while ((pag = xfs_perag_get(mp, ag))) {
>  		ag = pag->pag_agno + 1;
> -		error = xfs_inode_ag_walk(mp, pag, execute, flags, args, -1,
> -					  iter_flags);
> +		error = xfs_inode_ag_walk(mp, pag, execute, flags, args,
> +				XFS_ICI_NO_TAG, iter_flags);
>  		xfs_perag_put(pag);
>  		if (error) {
>  			last_error = error;
> 


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 03/12] xfs: remove unused xfs_inode_ag_iterator function
  2020-05-22  2:53 ` [PATCH 03/12] xfs: remove unused xfs_inode_ag_iterator function Darrick J. Wong
@ 2020-05-22 12:03   ` Brian Foster
  0 siblings, 0 replies; 29+ messages in thread
From: Brian Foster @ 2020-05-22 12:03 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Christoph Hellwig, linux-xfs

On Thu, May 21, 2020 at 07:53:46PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Not used by anyone, so get rid of it.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  fs/xfs/xfs_icache.c |   11 -----------
>  fs/xfs/xfs_icache.h |    3 ---
>  2 files changed, 14 deletions(-)
> 
> 
> diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
> index b1e2541810be..6aafb547f21a 100644
> --- a/fs/xfs/xfs_icache.c
> +++ b/fs/xfs/xfs_icache.c
> @@ -985,17 +985,6 @@ xfs_inode_ag_iterator_flags(
>  	return last_error;
>  }
>  
> -int
> -xfs_inode_ag_iterator(
> -	struct xfs_mount	*mp,
> -	int			(*execute)(struct xfs_inode *ip, int flags,
> -					   void *args),
> -	int			flags,
> -	void			*args)
> -{
> -	return xfs_inode_ag_iterator_flags(mp, execute, flags, args, 0);
> -}
> -
>  int
>  xfs_inode_ag_iterator_tag(
>  	struct xfs_mount	*mp,
> diff --git a/fs/xfs/xfs_icache.h b/fs/xfs/xfs_icache.h
> index c13bc8a3e02f..0556fa32074f 100644
> --- a/fs/xfs/xfs_icache.h
> +++ b/fs/xfs/xfs_icache.h
> @@ -71,9 +71,6 @@ int xfs_inode_free_quota_cowblocks(struct xfs_inode *ip);
>  void xfs_cowblocks_worker(struct work_struct *);
>  void xfs_queue_cowblocks(struct xfs_mount *);
>  
> -int xfs_inode_ag_iterator(struct xfs_mount *mp,
> -	int (*execute)(struct xfs_inode *ip, int flags, void *args),
> -	int flags, void *args);
>  int xfs_inode_ag_iterator_flags(struct xfs_mount *mp,
>  	int (*execute)(struct xfs_inode *ip, int flags, void *args),
>  	int flags, void *args, int iter_flags);
> 


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 04/12] xfs: remove xfs_inode_ag_iterator_flags
  2020-05-22  2:53 ` [PATCH 04/12] xfs: remove xfs_inode_ag_iterator_flags Darrick J. Wong
@ 2020-05-22 12:03   ` Brian Foster
  0 siblings, 0 replies; 29+ messages in thread
From: Brian Foster @ 2020-05-22 12:03 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Christoph Hellwig, linux-xfs

On Thu, May 21, 2020 at 07:53:53PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Combine xfs_inode_ag_iterator_flags and xfs_inode_ag_iterator_tag into a
> single wrapper function since there's only one caller of the _flags
> variant.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  fs/xfs/xfs_icache.c      |   43 +++++++++++++------------------------------
>  fs/xfs/xfs_icache.h      |    5 +----
>  fs/xfs/xfs_qm_syscalls.c |    4 ++--
>  3 files changed, 16 insertions(+), 36 deletions(-)
> 
> 
> diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
> index 6aafb547f21a..6d7f3014d547 100644
> --- a/fs/xfs/xfs_icache.c
> +++ b/fs/xfs/xfs_icache.c
> @@ -956,38 +956,22 @@ xfs_cowblocks_worker(
>  	xfs_queue_cowblocks(mp);
>  }
>  
> -int
> -xfs_inode_ag_iterator_flags(
> +/* Fetch the next (possibly tagged) per-AG structure. */
> +static inline struct xfs_perag *
> +xfs_inode_walk_get_perag(
>  	struct xfs_mount	*mp,
> -	int			(*execute)(struct xfs_inode *ip, int flags,
> -					   void *args),
> -	int			flags,
> -	void			*args,
> -	int			iter_flags)
> +	xfs_agnumber_t		agno,
> +	int			tag)
>  {
> -	struct xfs_perag	*pag;
> -	int			error = 0;
> -	int			last_error = 0;
> -	xfs_agnumber_t		ag;
> -
> -	ag = 0;
> -	while ((pag = xfs_perag_get(mp, ag))) {
> -		ag = pag->pag_agno + 1;
> -		error = xfs_inode_ag_walk(mp, pag, execute, flags, args,
> -				XFS_ICI_NO_TAG, iter_flags);
> -		xfs_perag_put(pag);
> -		if (error) {
> -			last_error = error;
> -			if (error == -EFSCORRUPTED)
> -				break;
> -		}
> -	}
> -	return last_error;
> +	if (tag == XFS_ICI_NO_TAG)
> +		return xfs_perag_get(mp, agno);
> +	return xfs_perag_get_tag(mp, agno, tag);
>  }
>  
>  int
> -xfs_inode_ag_iterator_tag(
> +xfs_inode_ag_iterator(
>  	struct xfs_mount	*mp,
> +	int			iter_flags,
>  	int			(*execute)(struct xfs_inode *ip, int flags,
>  					   void *args),
>  	int			flags,
> @@ -1000,10 +984,10 @@ xfs_inode_ag_iterator_tag(
>  	xfs_agnumber_t		ag;
>  
>  	ag = 0;
> -	while ((pag = xfs_perag_get_tag(mp, ag, tag))) {
> +	while ((pag = xfs_inode_walk_get_perag(mp, ag, tag))) {
>  		ag = pag->pag_agno + 1;
>  		error = xfs_inode_ag_walk(mp, pag, execute, flags, args, tag,
> -					  0);
> +				iter_flags);
>  		xfs_perag_put(pag);
>  		if (error) {
>  			last_error = error;
> @@ -1523,8 +1507,7 @@ __xfs_icache_free_eofblocks(
>  	if (eofb && (eofb->eof_flags & XFS_EOF_FLAGS_SYNC))
>  		flags = SYNC_WAIT;
>  
> -	return xfs_inode_ag_iterator_tag(mp, execute, flags,
> -					 eofb, tag);
> +	return xfs_inode_ag_iterator(mp, 0, execute, flags, eofb, tag);
>  }
>  
>  int
> diff --git a/fs/xfs/xfs_icache.h b/fs/xfs/xfs_icache.h
> index 0556fa32074f..2d5ab9957d9f 100644
> --- a/fs/xfs/xfs_icache.h
> +++ b/fs/xfs/xfs_icache.h
> @@ -71,10 +71,7 @@ int xfs_inode_free_quota_cowblocks(struct xfs_inode *ip);
>  void xfs_cowblocks_worker(struct work_struct *);
>  void xfs_queue_cowblocks(struct xfs_mount *);
>  
> -int xfs_inode_ag_iterator_flags(struct xfs_mount *mp,
> -	int (*execute)(struct xfs_inode *ip, int flags, void *args),
> -	int flags, void *args, int iter_flags);
> -int xfs_inode_ag_iterator_tag(struct xfs_mount *mp,
> +int xfs_inode_ag_iterator(struct xfs_mount *mp, int iter_flags,
>  	int (*execute)(struct xfs_inode *ip, int flags, void *args),
>  	int flags, void *args, int tag);
>  
> diff --git a/fs/xfs/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c
> index 5d5ac65aa1cc..a9460bdcca87 100644
> --- a/fs/xfs/xfs_qm_syscalls.c
> +++ b/fs/xfs/xfs_qm_syscalls.c
> @@ -772,6 +772,6 @@ xfs_qm_dqrele_all_inodes(
>  	uint		 flags)
>  {
>  	ASSERT(mp->m_quotainfo);
> -	xfs_inode_ag_iterator_flags(mp, xfs_dqrele_inode, flags, NULL,
> -				    XFS_AGITER_INEW_WAIT);
> +	xfs_inode_ag_iterator(mp, XFS_AGITER_INEW_WAIT, xfs_dqrele_inode,
> +			flags, NULL, XFS_ICI_NO_TAG);
>  }
> 


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 05/12] xfs: remove flags argument from xfs_inode_ag_walk
  2020-05-22  2:53 ` [PATCH 05/12] xfs: remove flags argument from xfs_inode_ag_walk Darrick J. Wong
  2020-05-22  6:37   ` Christoph Hellwig
@ 2020-05-22 12:03   ` Brian Foster
  1 sibling, 0 replies; 29+ messages in thread
From: Brian Foster @ 2020-05-22 12:03 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-xfs, hch

On Thu, May 21, 2020 at 07:53:59PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> The incore inode walk code passes a flags argument and a pointer from
> the xfs_inode_ag_iterator caller all the way to the iteration function.
> We can reduce the function complexity by passing flags through the
> private pointer.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  fs/xfs/xfs_icache.c      |   43 +++++++++++++++++--------------------------
>  fs/xfs/xfs_icache.h      |    4 ++--
>  fs/xfs/xfs_qm_syscalls.c |   15 ++++++++-------
>  3 files changed, 27 insertions(+), 35 deletions(-)
> 
> 
> diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
> index 6d7f3014d547..53c6cc7bc02a 100644
> --- a/fs/xfs/xfs_icache.c
> +++ b/fs/xfs/xfs_icache.c
> @@ -790,9 +790,7 @@ STATIC int
>  xfs_inode_ag_walk(
>  	struct xfs_mount	*mp,
>  	struct xfs_perag	*pag,
> -	int			(*execute)(struct xfs_inode *ip, int flags,
> -					   void *args),
> -	int			flags,
> +	int			(*execute)(struct xfs_inode *ip, void *args),
>  	void			*args,
>  	int			tag,
>  	int			iter_flags)
> @@ -868,7 +866,7 @@ xfs_inode_ag_walk(
>  			if ((iter_flags & XFS_AGITER_INEW_WAIT) &&
>  			    xfs_iflags_test(batch[i], XFS_INEW))
>  				xfs_inew_wait(batch[i]);
> -			error = execute(batch[i], flags, args);
> +			error = execute(batch[i], args);
>  			xfs_irele(batch[i]);
>  			if (error == -EAGAIN) {
>  				skipped++;
> @@ -972,9 +970,7 @@ int
>  xfs_inode_ag_iterator(
>  	struct xfs_mount	*mp,
>  	int			iter_flags,
> -	int			(*execute)(struct xfs_inode *ip, int flags,
> -					   void *args),
> -	int			flags,
> +	int			(*execute)(struct xfs_inode *ip, void *args),
>  	void			*args,
>  	int			tag)
>  {
> @@ -986,7 +982,7 @@ xfs_inode_ag_iterator(
>  	ag = 0;
>  	while ((pag = xfs_inode_walk_get_perag(mp, ag, tag))) {
>  		ag = pag->pag_agno + 1;
> -		error = xfs_inode_ag_walk(mp, pag, execute, flags, args, tag,
> +		error = xfs_inode_ag_walk(mp, pag, execute, args, tag,
>  				iter_flags);
>  		xfs_perag_put(pag);
>  		if (error) {
> @@ -1443,12 +1439,14 @@ xfs_inode_match_id_union(
>  STATIC int
>  xfs_inode_free_eofblocks(
>  	struct xfs_inode	*ip,
> -	int			flags,
>  	void			*args)
>  {
> -	int ret = 0;
> -	struct xfs_eofblocks *eofb = args;
> -	int match;
> +	struct xfs_eofblocks	*eofb = args;
> +	bool			wait;
> +	int			match;
> +	int			ret;
> +
> +	wait = eofb && (eofb->eof_flags & XFS_EOF_FLAGS_SYNC);
>  
>  	if (!xfs_can_free_eofblocks(ip, false)) {
>  		/* inode could be preallocated or append-only */
> @@ -1461,8 +1459,7 @@ xfs_inode_free_eofblocks(
>  	 * If the mapping is dirty the operation can block and wait for some
>  	 * time. Unless we are waiting, skip it.
>  	 */
> -	if (!(flags & SYNC_WAIT) &&
> -	    mapping_tagged(VFS_I(ip)->i_mapping, PAGECACHE_TAG_DIRTY))
> +	if (!wait && mapping_tagged(VFS_I(ip)->i_mapping, PAGECACHE_TAG_DIRTY))
>  		return 0;
>  
>  	if (eofb) {
> @@ -1484,10 +1481,11 @@ xfs_inode_free_eofblocks(
>  	 * scanner moving and revisit the inode in a subsequent pass.
>  	 */
>  	if (!xfs_ilock_nowait(ip, XFS_IOLOCK_EXCL)) {
> -		if (flags & SYNC_WAIT)
> -			ret = -EAGAIN;
> -		return ret;
> +		if (wait)
> +			return -EAGAIN;
> +		return 0;
>  	}
> +
>  	ret = xfs_free_eofblocks(ip);
>  	xfs_iunlock(ip, XFS_IOLOCK_EXCL);
>  
> @@ -1498,16 +1496,10 @@ static int
>  __xfs_icache_free_eofblocks(
>  	struct xfs_mount	*mp,
>  	struct xfs_eofblocks	*eofb,
> -	int			(*execute)(struct xfs_inode *ip, int flags,
> -					   void *args),
> +	int			(*execute)(struct xfs_inode *ip, void *args),
>  	int			tag)
>  {
> -	int flags = SYNC_TRYLOCK;
> -
> -	if (eofb && (eofb->eof_flags & XFS_EOF_FLAGS_SYNC))
> -		flags = SYNC_WAIT;
> -
> -	return xfs_inode_ag_iterator(mp, 0, execute, flags, eofb, tag);
> +	return xfs_inode_ag_iterator(mp, 0, execute, eofb, tag);
>  }
>  
>  int
> @@ -1732,7 +1724,6 @@ xfs_prep_free_cowblocks(
>  STATIC int
>  xfs_inode_free_cowblocks(
>  	struct xfs_inode	*ip,
> -	int			flags,
>  	void			*args)
>  {
>  	struct xfs_eofblocks	*eofb = args;
> diff --git a/fs/xfs/xfs_icache.h b/fs/xfs/xfs_icache.h
> index 2d5ab9957d9f..e7f86ebd7b22 100644
> --- a/fs/xfs/xfs_icache.h
> +++ b/fs/xfs/xfs_icache.h
> @@ -72,8 +72,8 @@ void xfs_cowblocks_worker(struct work_struct *);
>  void xfs_queue_cowblocks(struct xfs_mount *);
>  
>  int xfs_inode_ag_iterator(struct xfs_mount *mp, int iter_flags,
> -	int (*execute)(struct xfs_inode *ip, int flags, void *args),
> -	int flags, void *args, int tag);
> +	int (*execute)(struct xfs_inode *ip, void *args),
> +	void *args, int tag);
>  
>  int xfs_icache_inode_is_allocated(struct xfs_mount *mp, struct xfs_trans *tp,
>  				  xfs_ino_t ino, bool *inuse);
> diff --git a/fs/xfs/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c
> index a9460bdcca87..4b61a683a43e 100644
> --- a/fs/xfs/xfs_qm_syscalls.c
> +++ b/fs/xfs/xfs_qm_syscalls.c
> @@ -729,9 +729,10 @@ xfs_qm_scall_getquota_next(
>  STATIC int
>  xfs_dqrele_inode(
>  	struct xfs_inode	*ip,
> -	int			flags,
>  	void			*args)
>  {
> +	uint			*flags = args;
> +
>  	/* skip quota inodes */
>  	if (ip == ip->i_mount->m_quotainfo->qi_uquotaip ||
>  	    ip == ip->i_mount->m_quotainfo->qi_gquotaip ||
> @@ -743,15 +744,15 @@ xfs_dqrele_inode(
>  	}
>  
>  	xfs_ilock(ip, XFS_ILOCK_EXCL);
> -	if ((flags & XFS_UQUOTA_ACCT) && ip->i_udquot) {
> +	if ((*flags & XFS_UQUOTA_ACCT) && ip->i_udquot) {
>  		xfs_qm_dqrele(ip->i_udquot);
>  		ip->i_udquot = NULL;
>  	}
> -	if ((flags & XFS_GQUOTA_ACCT) && ip->i_gdquot) {
> +	if ((*flags & XFS_GQUOTA_ACCT) && ip->i_gdquot) {
>  		xfs_qm_dqrele(ip->i_gdquot);
>  		ip->i_gdquot = NULL;
>  	}
> -	if ((flags & XFS_PQUOTA_ACCT) && ip->i_pdquot) {
> +	if ((*flags & XFS_PQUOTA_ACCT) && ip->i_pdquot) {
>  		xfs_qm_dqrele(ip->i_pdquot);
>  		ip->i_pdquot = NULL;
>  	}
> @@ -768,10 +769,10 @@ xfs_dqrele_inode(
>   */
>  void
>  xfs_qm_dqrele_all_inodes(
> -	struct xfs_mount *mp,
> -	uint		 flags)
> +	struct xfs_mount	*mp,
> +	uint			flags)
>  {
>  	ASSERT(mp->m_quotainfo);
>  	xfs_inode_ag_iterator(mp, XFS_AGITER_INEW_WAIT, xfs_dqrele_inode,
> -			flags, NULL, XFS_ICI_NO_TAG);
> +			&flags, XFS_ICI_NO_TAG);
>  }
> 


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 06/12] xfs: remove __xfs_icache_free_eofblocks
  2020-05-22  2:54 ` [PATCH 06/12] xfs: remove __xfs_icache_free_eofblocks Darrick J. Wong
@ 2020-05-22 12:03   ` Brian Foster
  0 siblings, 0 replies; 29+ messages in thread
From: Brian Foster @ 2020-05-22 12:03 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Christoph Hellwig, linux-xfs

On Thu, May 21, 2020 at 07:54:06PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> This is now a pointless wrapper, so kill it.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  fs/xfs/xfs_icache.c |   14 ++------------
>  1 file changed, 2 insertions(+), 12 deletions(-)
> 
> 
> diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
> index 53c6cc7bc02a..11a5e6897639 100644
> --- a/fs/xfs/xfs_icache.c
> +++ b/fs/xfs/xfs_icache.c
> @@ -1492,22 +1492,12 @@ xfs_inode_free_eofblocks(
>  	return ret;
>  }
>  
> -static int
> -__xfs_icache_free_eofblocks(
> -	struct xfs_mount	*mp,
> -	struct xfs_eofblocks	*eofb,
> -	int			(*execute)(struct xfs_inode *ip, void *args),
> -	int			tag)
> -{
> -	return xfs_inode_ag_iterator(mp, 0, execute, eofb, tag);
> -}
> -
>  int
>  xfs_icache_free_eofblocks(
>  	struct xfs_mount	*mp,
>  	struct xfs_eofblocks	*eofb)
>  {
> -	return __xfs_icache_free_eofblocks(mp, eofb, xfs_inode_free_eofblocks,
> +	return xfs_inode_ag_iterator(mp, 0, xfs_inode_free_eofblocks, eofb,
>  			XFS_ICI_EOFBLOCKS_TAG);
>  }
>  
> @@ -1769,7 +1759,7 @@ xfs_icache_free_cowblocks(
>  	struct xfs_mount	*mp,
>  	struct xfs_eofblocks	*eofb)
>  {
> -	return __xfs_icache_free_eofblocks(mp, eofb, xfs_inode_free_cowblocks,
> +	return xfs_inode_ag_iterator(mp, 0, xfs_inode_free_cowblocks, eofb,
>  			XFS_ICI_COWBLOCKS_TAG);
>  }
>  
> 


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 07/12] xfs: refactor eofb matching into a single helper
  2020-05-22  2:54 ` [PATCH 07/12] xfs: refactor eofb matching into a single helper Darrick J. Wong
  2020-05-22  6:38   ` Christoph Hellwig
@ 2020-05-22 12:23   ` Brian Foster
  1 sibling, 0 replies; 29+ messages in thread
From: Brian Foster @ 2020-05-22 12:23 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-xfs, hch

On Thu, May 21, 2020 at 07:54:12PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Refactor the two eofb-matching logics into a single helper so that we
> don't repeat ourselves.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  fs/xfs/xfs_icache.c |   62 ++++++++++++++++++++++++++++-----------------------
>  1 file changed, 34 insertions(+), 28 deletions(-)
> 
> 
> diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
> index 11a5e6897639..3a45ec948c1a 100644
> --- a/fs/xfs/xfs_icache.c
> +++ b/fs/xfs/xfs_icache.c
> @@ -1436,6 +1436,36 @@ xfs_inode_match_id_union(
>  	return 0;
>  }
>  
> +/*
> + * Is this inode @ip eligible for eof/cow block reclamation, given some
> + * filtering parameters @eofb?  The inode is eligible if @eofb is null or
> + * if the predicate functions match.
> + */
> +static bool
> +xfs_inode_matches_eofb(
> +	struct xfs_inode	*ip,
> +	struct xfs_eofblocks	*eofb)
> +{
> +	int			match;
> +
> +	if (!eofb)
> +		return true;
> +
> +	if (eofb->eof_flags & XFS_EOF_FLAGS_UNION)
> +		match = xfs_inode_match_id_union(ip, eofb);
> +	else
> +		match = xfs_inode_match_id(ip, eofb);
> +	if (!match)
> +		return false;
> +
> +	/* skip the inode if the file size is too small */
> +	if ((eofb->eof_flags & XFS_EOF_FLAGS_MINFILESIZE) &&
> +	    XFS_ISIZE(ip) < eofb->eof_min_file_size)
> +		return false;
> +
> +	return true;
> +}
> +
>  STATIC int
>  xfs_inode_free_eofblocks(
>  	struct xfs_inode	*ip,
> @@ -1443,7 +1473,6 @@ xfs_inode_free_eofblocks(
>  {
>  	struct xfs_eofblocks	*eofb = args;
>  	bool			wait;
> -	int			match;
>  	int			ret;
>  
>  	wait = eofb && (eofb->eof_flags & XFS_EOF_FLAGS_SYNC);
> @@ -1462,19 +1491,8 @@ xfs_inode_free_eofblocks(
>  	if (!wait && mapping_tagged(VFS_I(ip)->i_mapping, PAGECACHE_TAG_DIRTY))
>  		return 0;
>  
> -	if (eofb) {
> -		if (eofb->eof_flags & XFS_EOF_FLAGS_UNION)
> -			match = xfs_inode_match_id_union(ip, eofb);
> -		else
> -			match = xfs_inode_match_id(ip, eofb);
> -		if (!match)
> -			return 0;
> -
> -		/* skip the inode if the file size is too small */
> -		if (eofb->eof_flags & XFS_EOF_FLAGS_MINFILESIZE &&
> -		    XFS_ISIZE(ip) < eofb->eof_min_file_size)
> -			return 0;
> -	}
> +	if (!xfs_inode_matches_eofb(ip, eofb))
> +		return 0;
>  
>  	/*
>  	 * If the caller is waiting, return -EAGAIN to keep the background
> @@ -1717,25 +1735,13 @@ xfs_inode_free_cowblocks(
>  	void			*args)
>  {
>  	struct xfs_eofblocks	*eofb = args;
> -	int			match;
>  	int			ret = 0;
>  
>  	if (!xfs_prep_free_cowblocks(ip))
>  		return 0;
>  
> -	if (eofb) {
> -		if (eofb->eof_flags & XFS_EOF_FLAGS_UNION)
> -			match = xfs_inode_match_id_union(ip, eofb);
> -		else
> -			match = xfs_inode_match_id(ip, eofb);
> -		if (!match)
> -			return 0;
> -
> -		/* skip the inode if the file size is too small */
> -		if (eofb->eof_flags & XFS_EOF_FLAGS_MINFILESIZE &&
> -		    XFS_ISIZE(ip) < eofb->eof_min_file_size)
> -			return 0;
> -	}
> +	if (!xfs_inode_matches_eofb(ip, eofb))
> +		return 0;
>  
>  	/* Free the CoW blocks */
>  	xfs_ilock(ip, XFS_IOLOCK_EXCL);
> 


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 08/12] xfs: fix inode ag walk predicate function return values
  2020-05-22  2:54 ` [PATCH 08/12] xfs: fix inode ag walk predicate function return values Darrick J. Wong
@ 2020-05-22 12:23   ` Brian Foster
  0 siblings, 0 replies; 29+ messages in thread
From: Brian Foster @ 2020-05-22 12:23 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Christoph Hellwig, linux-xfs

On Thu, May 21, 2020 at 07:54:19PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> There are a number of predicate functions that help the incore inode
> walking code decide if we really want to apply the iteration function to
> the inode.  These are boolean decisions, so change the return types to
> boolean to match.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  fs/xfs/xfs_icache.c |   39 ++++++++++++++++++++++-----------------
>  1 file changed, 22 insertions(+), 17 deletions(-)
> 
> 
> diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
> index 3a45ec948c1a..31d85cc4bd8b 100644
> --- a/fs/xfs/xfs_icache.c
> +++ b/fs/xfs/xfs_icache.c
> @@ -741,7 +741,12 @@ xfs_icache_inode_is_allocated(
>   */
>  #define XFS_LOOKUP_BATCH	32
>  
> -STATIC int
> +/*
> + * Decide if the given @ip is eligible to be a part of the inode walk, and
> + * grab it if so.  Returns true if it's ready to go or false if we should just
> + * ignore it.
> + */
> +STATIC bool
>  xfs_inode_ag_walk_grab(
>  	struct xfs_inode	*ip,
>  	int			flags)
> @@ -772,18 +777,18 @@ xfs_inode_ag_walk_grab(
>  
>  	/* nothing to sync during shutdown */
>  	if (XFS_FORCED_SHUTDOWN(ip->i_mount))
> -		return -EFSCORRUPTED;
> +		return false;
>  
>  	/* If we can't grab the inode, it must on it's way to reclaim. */
>  	if (!igrab(inode))
> -		return -ENOENT;
> +		return false;
>  
>  	/* inode is valid */
> -	return 0;
> +	return true;
>  
>  out_unlock_noent:
>  	spin_unlock(&ip->i_flags_lock);
> -	return -ENOENT;
> +	return false;
>  }
>  
>  STATIC int
> @@ -835,7 +840,7 @@ xfs_inode_ag_walk(
>  		for (i = 0; i < nr_found; i++) {
>  			struct xfs_inode *ip = batch[i];
>  
> -			if (done || xfs_inode_ag_walk_grab(ip, iter_flags))
> +			if (done || !xfs_inode_ag_walk_grab(ip, iter_flags))
>  				batch[i] = NULL;
>  
>  			/*
> @@ -1392,48 +1397,48 @@ xfs_reclaim_inodes_count(
>  	return reclaimable;
>  }
>  
> -STATIC int
> +STATIC bool
>  xfs_inode_match_id(
>  	struct xfs_inode	*ip,
>  	struct xfs_eofblocks	*eofb)
>  {
>  	if ((eofb->eof_flags & XFS_EOF_FLAGS_UID) &&
>  	    !uid_eq(VFS_I(ip)->i_uid, eofb->eof_uid))
> -		return 0;
> +		return false;
>  
>  	if ((eofb->eof_flags & XFS_EOF_FLAGS_GID) &&
>  	    !gid_eq(VFS_I(ip)->i_gid, eofb->eof_gid))
> -		return 0;
> +		return false;
>  
>  	if ((eofb->eof_flags & XFS_EOF_FLAGS_PRID) &&
>  	    ip->i_d.di_projid != eofb->eof_prid)
> -		return 0;
> +		return false;
>  
> -	return 1;
> +	return true;
>  }
>  
>  /*
>   * A union-based inode filtering algorithm. Process the inode if any of the
>   * criteria match. This is for global/internal scans only.
>   */
> -STATIC int
> +STATIC bool
>  xfs_inode_match_id_union(
>  	struct xfs_inode	*ip,
>  	struct xfs_eofblocks	*eofb)
>  {
>  	if ((eofb->eof_flags & XFS_EOF_FLAGS_UID) &&
>  	    uid_eq(VFS_I(ip)->i_uid, eofb->eof_uid))
> -		return 1;
> +		return true;
>  
>  	if ((eofb->eof_flags & XFS_EOF_FLAGS_GID) &&
>  	    gid_eq(VFS_I(ip)->i_gid, eofb->eof_gid))
> -		return 1;
> +		return true;
>  
>  	if ((eofb->eof_flags & XFS_EOF_FLAGS_PRID) &&
>  	    ip->i_d.di_projid == eofb->eof_prid)
> -		return 1;
> +		return true;
>  
> -	return 0;
> +	return false;
>  }
>  
>  /*
> @@ -1446,7 +1451,7 @@ xfs_inode_matches_eofb(
>  	struct xfs_inode	*ip,
>  	struct xfs_eofblocks	*eofb)
>  {
> -	int			match;
> +	bool			match;
>  
>  	if (!eofb)
>  		return true;
> 


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 09/12] xfs: use bool for done in xfs_inode_ag_walk
  2020-05-22  2:54 ` [PATCH 09/12] xfs: use bool for done in xfs_inode_ag_walk Darrick J. Wong
@ 2020-05-22 12:23   ` Brian Foster
  0 siblings, 0 replies; 29+ messages in thread
From: Brian Foster @ 2020-05-22 12:23 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Christoph Hellwig, linux-xfs

On Thu, May 21, 2020 at 07:54:25PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> This is a boolean variable, so use the bool type.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  fs/xfs/xfs_icache.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> 
> diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
> index 31d85cc4bd8b..791544a1d54c 100644
> --- a/fs/xfs/xfs_icache.c
> +++ b/fs/xfs/xfs_icache.c
> @@ -803,11 +803,11 @@ xfs_inode_ag_walk(
>  	uint32_t		first_index;
>  	int			last_error = 0;
>  	int			skipped;
> -	int			done;
> +	bool			done;
>  	int			nr_found;
>  
>  restart:
> -	done = 0;
> +	done = false;
>  	skipped = 0;
>  	first_index = 0;
>  	nr_found = 0;
> @@ -859,7 +859,7 @@ xfs_inode_ag_walk(
>  				continue;
>  			first_index = XFS_INO_TO_AGINO(mp, ip->i_ino + 1);
>  			if (first_index < XFS_INO_TO_AGINO(mp, ip->i_ino))
> -				done = 1;
> +				done = true;
>  		}
>  
>  		/* unlock now we've grabbed the inodes. */
> 


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 10/12] xfs: move xfs_inode_ag_iterator to be closer to the perag walking code
  2020-05-22  2:54 ` [PATCH 10/12] xfs: move xfs_inode_ag_iterator to be closer to the perag walking code Darrick J. Wong
@ 2020-05-22 12:23   ` Brian Foster
  0 siblings, 0 replies; 29+ messages in thread
From: Brian Foster @ 2020-05-22 12:23 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Christoph Hellwig, linux-xfs

On Thu, May 21, 2020 at 07:54:32PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Move the xfs_inode_ag_iterator function to be nearer xfs_inode_ag_walk
> so that we don't have to scroll back and forth to figure out how the
> incore inode walking function works.  No functional changes.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  fs/xfs/xfs_icache.c |   88 ++++++++++++++++++++++++++++-----------------------
>  1 file changed, 48 insertions(+), 40 deletions(-)
> 
> 
> diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
> index 791544a1d54c..0e25d50372e2 100644
> --- a/fs/xfs/xfs_icache.c
> +++ b/fs/xfs/xfs_icache.c
> @@ -791,6 +791,10 @@ xfs_inode_ag_walk_grab(
>  	return false;
>  }
>  
> +/*
> + * For a given per-AG structure @pag, grab, @execute, and rele all incore
> + * inodes with the given radix tree @tag.
> + */
>  STATIC int
>  xfs_inode_ag_walk(
>  	struct xfs_mount	*mp,
> @@ -896,6 +900,50 @@ xfs_inode_ag_walk(
>  	return last_error;
>  }
>  
> +/* Fetch the next (possibly tagged) per-AG structure. */
> +static inline struct xfs_perag *
> +xfs_inode_walk_get_perag(
> +	struct xfs_mount	*mp,
> +	xfs_agnumber_t		agno,
> +	int			tag)
> +{
> +	if (tag == XFS_ICI_NO_TAG)
> +		return xfs_perag_get(mp, agno);
> +	return xfs_perag_get_tag(mp, agno, tag);
> +}
> +
> +/*
> + * Call the @execute function on all incore inodes matching the radix tree
> + * @tag.
> + */
> +int
> +xfs_inode_ag_iterator(
> +	struct xfs_mount	*mp,
> +	int			iter_flags,
> +	int			(*execute)(struct xfs_inode *ip, void *args),
> +	void			*args,
> +	int			tag)
> +{
> +	struct xfs_perag	*pag;
> +	int			error = 0;
> +	int			last_error = 0;
> +	xfs_agnumber_t		ag;
> +
> +	ag = 0;
> +	while ((pag = xfs_inode_walk_get_perag(mp, ag, tag))) {
> +		ag = pag->pag_agno + 1;
> +		error = xfs_inode_ag_walk(mp, pag, execute, args, tag,
> +				iter_flags);
> +		xfs_perag_put(pag);
> +		if (error) {
> +			last_error = error;
> +			if (error == -EFSCORRUPTED)
> +				break;
> +		}
> +	}
> +	return last_error;
> +}
> +
>  /*
>   * Background scanning to trim post-EOF preallocated space. This is queued
>   * based on the 'speculative_prealloc_lifetime' tunable (5m by default).
> @@ -959,46 +1007,6 @@ xfs_cowblocks_worker(
>  	xfs_queue_cowblocks(mp);
>  }
>  
> -/* Fetch the next (possibly tagged) per-AG structure. */
> -static inline struct xfs_perag *
> -xfs_inode_walk_get_perag(
> -	struct xfs_mount	*mp,
> -	xfs_agnumber_t		agno,
> -	int			tag)
> -{
> -	if (tag == XFS_ICI_NO_TAG)
> -		return xfs_perag_get(mp, agno);
> -	return xfs_perag_get_tag(mp, agno, tag);
> -}
> -
> -int
> -xfs_inode_ag_iterator(
> -	struct xfs_mount	*mp,
> -	int			iter_flags,
> -	int			(*execute)(struct xfs_inode *ip, void *args),
> -	void			*args,
> -	int			tag)
> -{
> -	struct xfs_perag	*pag;
> -	int			error = 0;
> -	int			last_error = 0;
> -	xfs_agnumber_t		ag;
> -
> -	ag = 0;
> -	while ((pag = xfs_inode_walk_get_perag(mp, ag, tag))) {
> -		ag = pag->pag_agno + 1;
> -		error = xfs_inode_ag_walk(mp, pag, execute, args, tag,
> -				iter_flags);
> -		xfs_perag_put(pag);
> -		if (error) {
> -			last_error = error;
> -			if (error == -EFSCORRUPTED)
> -				break;
> -		}
> -	}
> -	return last_error;
> -}
> -
>  /*
>   * Grab the inode for reclaim exclusively.
>   * Return 0 if we grabbed it, non-zero otherwise.
> 


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 11/12] xfs: straighten out all the naming around incore inode tree walks
  2020-05-22  2:54 ` [PATCH 11/12] xfs: straighten out all the naming around incore inode tree walks Darrick J. Wong
  2020-05-22  6:38   ` Christoph Hellwig
@ 2020-05-22 12:23   ` Brian Foster
  1 sibling, 0 replies; 29+ messages in thread
From: Brian Foster @ 2020-05-22 12:23 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-xfs, hch

On Thu, May 21, 2020 at 07:54:38PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> We're not very consistent about function names for the incore inode
> iteration function.  Turn them all into xfs_inode_walk* variants.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---

Seems reasonable:

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  fs/xfs/xfs_icache.c      |   18 +++++++++---------
>  fs/xfs/xfs_icache.h      |    6 +++---
>  fs/xfs/xfs_qm_syscalls.c |    2 +-
>  3 files changed, 13 insertions(+), 13 deletions(-)
> 
> 
> diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
> index 0e25d50372e2..baf59087caa5 100644
> --- a/fs/xfs/xfs_icache.c
> +++ b/fs/xfs/xfs_icache.c
> @@ -747,12 +747,12 @@ xfs_icache_inode_is_allocated(
>   * ignore it.
>   */
>  STATIC bool
> -xfs_inode_ag_walk_grab(
> +xfs_inode_walk_ag_grab(
>  	struct xfs_inode	*ip,
>  	int			flags)
>  {
>  	struct inode		*inode = VFS_I(ip);
> -	bool			newinos = !!(flags & XFS_AGITER_INEW_WAIT);
> +	bool			newinos = !!(flags & XFS_INODE_WALK_INEW_WAIT);
>  
>  	ASSERT(rcu_read_lock_held());
>  
> @@ -796,7 +796,7 @@ xfs_inode_ag_walk_grab(
>   * inodes with the given radix tree @tag.
>   */
>  STATIC int
> -xfs_inode_ag_walk(
> +xfs_inode_walk_ag(
>  	struct xfs_mount	*mp,
>  	struct xfs_perag	*pag,
>  	int			(*execute)(struct xfs_inode *ip, void *args),
> @@ -844,7 +844,7 @@ xfs_inode_ag_walk(
>  		for (i = 0; i < nr_found; i++) {
>  			struct xfs_inode *ip = batch[i];
>  
> -			if (done || !xfs_inode_ag_walk_grab(ip, iter_flags))
> +			if (done || !xfs_inode_walk_ag_grab(ip, iter_flags))
>  				batch[i] = NULL;
>  
>  			/*
> @@ -872,7 +872,7 @@ xfs_inode_ag_walk(
>  		for (i = 0; i < nr_found; i++) {
>  			if (!batch[i])
>  				continue;
> -			if ((iter_flags & XFS_AGITER_INEW_WAIT) &&
> +			if ((iter_flags & XFS_INODE_WALK_INEW_WAIT) &&
>  			    xfs_iflags_test(batch[i], XFS_INEW))
>  				xfs_inew_wait(batch[i]);
>  			error = execute(batch[i], args);
> @@ -917,7 +917,7 @@ xfs_inode_walk_get_perag(
>   * @tag.
>   */
>  int
> -xfs_inode_ag_iterator(
> +xfs_inode_walk(
>  	struct xfs_mount	*mp,
>  	int			iter_flags,
>  	int			(*execute)(struct xfs_inode *ip, void *args),
> @@ -932,7 +932,7 @@ xfs_inode_ag_iterator(
>  	ag = 0;
>  	while ((pag = xfs_inode_walk_get_perag(mp, ag, tag))) {
>  		ag = pag->pag_agno + 1;
> -		error = xfs_inode_ag_walk(mp, pag, execute, args, tag,
> +		error = xfs_inode_walk_ag(mp, pag, execute, args, tag,
>  				iter_flags);
>  		xfs_perag_put(pag);
>  		if (error) {
> @@ -1528,7 +1528,7 @@ xfs_icache_free_eofblocks(
>  	struct xfs_mount	*mp,
>  	struct xfs_eofblocks	*eofb)
>  {
> -	return xfs_inode_ag_iterator(mp, 0, xfs_inode_free_eofblocks, eofb,
> +	return xfs_inode_walk(mp, 0, xfs_inode_free_eofblocks, eofb,
>  			XFS_ICI_EOFBLOCKS_TAG);
>  }
>  
> @@ -1778,7 +1778,7 @@ xfs_icache_free_cowblocks(
>  	struct xfs_mount	*mp,
>  	struct xfs_eofblocks	*eofb)
>  {
> -	return xfs_inode_ag_iterator(mp, 0, xfs_inode_free_cowblocks, eofb,
> +	return xfs_inode_walk(mp, 0, xfs_inode_free_cowblocks, eofb,
>  			XFS_ICI_COWBLOCKS_TAG);
>  }
>  
> diff --git a/fs/xfs/xfs_icache.h b/fs/xfs/xfs_icache.h
> index e7f86ebd7b22..93b54e7d55f0 100644
> --- a/fs/xfs/xfs_icache.h
> +++ b/fs/xfs/xfs_icache.h
> @@ -24,7 +24,7 @@ struct xfs_eofblocks {
>   * tags for inode radix tree
>   */
>  #define XFS_ICI_NO_TAG		(-1)	/* special flag for an untagged lookup
> -					   in xfs_inode_ag_iterator */
> +					   in xfs_inode_walk */
>  #define XFS_ICI_RECLAIM_TAG	0	/* inode is to be reclaimed */
>  #define XFS_ICI_EOFBLOCKS_TAG	1	/* inode has blocks beyond EOF */
>  #define XFS_ICI_COWBLOCKS_TAG	2	/* inode can have cow blocks to gc */
> @@ -40,7 +40,7 @@ struct xfs_eofblocks {
>  /*
>   * flags for AG inode iterator
>   */
> -#define XFS_AGITER_INEW_WAIT	0x1	/* wait on new inodes */
> +#define XFS_INODE_WALK_INEW_WAIT	0x1	/* wait on new inodes */
>  
>  int xfs_iget(struct xfs_mount *mp, struct xfs_trans *tp, xfs_ino_t ino,
>  	     uint flags, uint lock_flags, xfs_inode_t **ipp);
> @@ -71,7 +71,7 @@ int xfs_inode_free_quota_cowblocks(struct xfs_inode *ip);
>  void xfs_cowblocks_worker(struct work_struct *);
>  void xfs_queue_cowblocks(struct xfs_mount *);
>  
> -int xfs_inode_ag_iterator(struct xfs_mount *mp, int iter_flags,
> +int xfs_inode_walk(struct xfs_mount *mp, int iter_flags,
>  	int (*execute)(struct xfs_inode *ip, void *args),
>  	void *args, int tag);
>  
> diff --git a/fs/xfs/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c
> index 4b61a683a43e..e8b63af93eb5 100644
> --- a/fs/xfs/xfs_qm_syscalls.c
> +++ b/fs/xfs/xfs_qm_syscalls.c
> @@ -773,6 +773,6 @@ xfs_qm_dqrele_all_inodes(
>  	uint			flags)
>  {
>  	ASSERT(mp->m_quotainfo);
> -	xfs_inode_ag_iterator(mp, XFS_AGITER_INEW_WAIT, xfs_dqrele_inode,
> +	xfs_inode_walk(mp, XFS_INODE_WALK_INEW_WAIT, xfs_dqrele_inode,
>  			&flags, XFS_ICI_NO_TAG);
>  }
> 


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 12/12] xfs: rearrange xfs_inode_walk_ag parameters
  2020-05-22  2:54 ` [PATCH 12/12] xfs: rearrange xfs_inode_walk_ag parameters Darrick J. Wong
  2020-05-22  6:39   ` Christoph Hellwig
@ 2020-05-22 12:23   ` Brian Foster
  1 sibling, 0 replies; 29+ messages in thread
From: Brian Foster @ 2020-05-22 12:23 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-xfs, hch

On Thu, May 21, 2020 at 07:54:45PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> The perag structure already has a pointer to the xfs_mount, so we don't
> need to pass that separately and can drop it.  Having done that, move
> iter_flags so that the argument order is the same between xfs_inode_walk
> and xfs_inode_walk_ag.  The latter will make things less confusing for a
> future patch that enables background scanning work to be done in
> parallel.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  fs/xfs/xfs_icache.c |    9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> 
> diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
> index baf59087caa5..fbd77467bb4d 100644
> --- a/fs/xfs/xfs_icache.c
> +++ b/fs/xfs/xfs_icache.c
> @@ -797,13 +797,13 @@ xfs_inode_walk_ag_grab(
>   */
>  STATIC int
>  xfs_inode_walk_ag(
> -	struct xfs_mount	*mp,
>  	struct xfs_perag	*pag,
> +	int			iter_flags,
>  	int			(*execute)(struct xfs_inode *ip, void *args),
>  	void			*args,
> -	int			tag,
> -	int			iter_flags)
> +	int			tag)
>  {
> +	struct xfs_mount	*mp = pag->pag_mount;
>  	uint32_t		first_index;
>  	int			last_error = 0;
>  	int			skipped;
> @@ -932,8 +932,7 @@ xfs_inode_walk(
>  	ag = 0;
>  	while ((pag = xfs_inode_walk_get_perag(mp, ag, tag))) {
>  		ag = pag->pag_agno + 1;
> -		error = xfs_inode_walk_ag(mp, pag, execute, args, tag,
> -				iter_flags);
> +		error = xfs_inode_walk_ag(pag, iter_flags, execute, args, tag);
>  		xfs_perag_put(pag);
>  		if (error) {
>  			last_error = error;
> 


^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2020-05-22 12:24 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-22  2:53 [PATCH v4 00/12] xfs: refactor incore inode walking Darrick J. Wong
2020-05-22  2:53 ` [PATCH 01/12] xfs: move eofblocks conversion function to xfs_ioctl.c Darrick J. Wong
2020-05-22 12:03   ` Brian Foster
2020-05-22  2:53 ` [PATCH 02/12] xfs: replace open-coded XFS_ICI_NO_TAG Darrick J. Wong
2020-05-22 12:03   ` Brian Foster
2020-05-22  2:53 ` [PATCH 03/12] xfs: remove unused xfs_inode_ag_iterator function Darrick J. Wong
2020-05-22 12:03   ` Brian Foster
2020-05-22  2:53 ` [PATCH 04/12] xfs: remove xfs_inode_ag_iterator_flags Darrick J. Wong
2020-05-22 12:03   ` Brian Foster
2020-05-22  2:53 ` [PATCH 05/12] xfs: remove flags argument from xfs_inode_ag_walk Darrick J. Wong
2020-05-22  6:37   ` Christoph Hellwig
2020-05-22 12:03   ` Brian Foster
2020-05-22  2:54 ` [PATCH 06/12] xfs: remove __xfs_icache_free_eofblocks Darrick J. Wong
2020-05-22 12:03   ` Brian Foster
2020-05-22  2:54 ` [PATCH 07/12] xfs: refactor eofb matching into a single helper Darrick J. Wong
2020-05-22  6:38   ` Christoph Hellwig
2020-05-22 12:23   ` Brian Foster
2020-05-22  2:54 ` [PATCH 08/12] xfs: fix inode ag walk predicate function return values Darrick J. Wong
2020-05-22 12:23   ` Brian Foster
2020-05-22  2:54 ` [PATCH 09/12] xfs: use bool for done in xfs_inode_ag_walk Darrick J. Wong
2020-05-22 12:23   ` Brian Foster
2020-05-22  2:54 ` [PATCH 10/12] xfs: move xfs_inode_ag_iterator to be closer to the perag walking code Darrick J. Wong
2020-05-22 12:23   ` Brian Foster
2020-05-22  2:54 ` [PATCH 11/12] xfs: straighten out all the naming around incore inode tree walks Darrick J. Wong
2020-05-22  6:38   ` Christoph Hellwig
2020-05-22 12:23   ` Brian Foster
2020-05-22  2:54 ` [PATCH 12/12] xfs: rearrange xfs_inode_walk_ag parameters Darrick J. Wong
2020-05-22  6:39   ` Christoph Hellwig
2020-05-22 12:23   ` Brian Foster

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).