diff mbox series

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

Message ID 161610683077.1887634.10625830989355684967.stgit@magnolia (mailing list archive)
State New
Headers show
Series xfs: reduce indirect function calls in inode walk | expand

Commit Message

Darrick J. Wong March 18, 2021, 10:33 p.m. UTC
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 mbox series

Patch

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;