Thread (9 messages) 9 messages, 2 authors, 2021-03-23
STALE1940d

[PATCH 2/3] xfs: reduce indirect calls in xfs_inode_walk{,_ag}

From: "Darrick J. Wong" <djwong@kernel.org>
Date: 2021-03-18 22:34:29
Subsystem: filesystems (vfs and infrastructure), the rest, xfs filesystem · Maintainers: Alexander Viro, Christian Brauner, Linus Torvalds, Carlos Maiolino

From: Darrick J. Wong <djwong@kernel.org>

Since the previous patch requires the forward static declaration of
xfs_blockgc_scan_inode, we can eliminate an indirect call from the body
of xfs_inode_walk_ag for a (probably minor) decrease in overhead.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 fs/xfs/xfs_icache.c |   16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
index 6924125a3c53..9198c7a7c3ca 100644
--- a/fs/xfs/xfs_icache.c
+++ b/fs/xfs/xfs_icache.c
@@ -858,8 +858,20 @@ xfs_inode_walk_ag(
 			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);
-			xfs_irele(batch[i]);
+			switch (tag) {
+			case XFS_ICI_BLOCKGC_TAG:
+				error = xfs_blockgc_scan_inode(batch[i], args);
+				xfs_irele(batch[i]);
+				break;
+			case XFS_ICI_NO_TAG:
+				error = execute(batch[i], args);
+				xfs_irele(batch[i]);
+				break;
+			default:
+				ASSERT(0);
+				error = -EFSCORRUPTED;
+				break;
+			}
 			if (error == -EAGAIN) {
 				skipped++;
 				continue;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help