tag name | inode-walk-cleanups_2021-06-14 (14872299f40b3ccfd371604abe2b879ed91875b7) |
tag date | 2021-06-14 17:24:14 -0700 |
tagged by | Darrick J. Wong <djwong@kernel.org> |
tagged object | commit 0df3f8d744... |
xfs: clean up incore inode walk functions
This ambitious series aims to cleans up redundant inode walk code in
xfs_icache.c, hide implementation details of the quotaoff dquot release
code, and eliminates indirect function calls from incore inode walks.
The first thing it does is to move all the code that quotaoff calls to
release dquots from all incore inodes into xfs_icache.c. Next, it
separates the goal of an inode walk from the actual radix tree tags that
may or may not be involved and drops the kludgy XFS_ICI_NO_TAG thing.
Finally, we split the speculative preallocation (blockgc) and quotaoff
dquot release code paths into separate functions so that we can keep the
implementations cohesive.
Christoph suggested last cycle that we 'simply' change quotaoff not to
allow deactivating quota entirely, but as these cleanups are to enable
one major change in behavior (deferred inode inactivation) I do not want
to add a second behavior change (quotaoff) as a dependency.
To be blunt: Additional cleanups are not in scope for this series.
Next, I made two observations about incore inode radix tree walks --
since there's a 1:1 mapping between the walk goal and the per-inode
processing function passed in, we can use the goal to make a direct call
to the processing function. Furthermore, the only caller to supply a
nonzero iter_flags argument is quotaoff, and there's only one INEW flag.
From that observation, I concluded that it's quite possible to remove
two parameters from the xfs_inode_walk* function signatures -- the
iter_flags, and the execute function pointer. The middle of the series
moves the INEW functionality into the one piece (quotaoff) that wants
it, and removes the indirect calls.
The final observation is that the inode reclaim walk loop is now almost
the same as xfs_inode_walk, so it's silly to maintain two copies. Merge
the reclaim loop code into xfs_inode_walk.
Lastly, refactor the per-ag radix tagging functions since there's
duplicated code that can be consolidated.
This series is a prerequisite for the next two patchsets, since deferred
inode inactivation will add another inode radix tree tag and iterator
function to xfs_inode_walk.
v2: walk the vfs inode list when running quotaoff instead of the radix
tree, then rework the (now completely internal) inode walk function
to take the tag as the main parameter.
v3: merge the reclaim loop into xfs_inode_walk, then consolidate the
radix tree tagging functions
v4: rebase to 5.13-rc4
v5: combine with the quotaoff patchset, reorder functions to minimize
forward declarations, split inode walk goals from radix tree tags
to reduce conceptual confusion
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEUzaAxoMeQq6m2jMV+H93GTRKtOsFAmDH8y4ACgkQ+H93GTRK
tOtU/A//W5tldw/2Kj4HlpMlZc0a6aU9GD+q3qVdlQlVmuU5sxNCGEPwJ3bcwyZu
eFUkMA7/33FiwwZAvCDnFj1EmFimkvuRQMUAY8AWzJ441BMPGp/jiu1LzC8jTzS7
4rfyqIJviWPH2PbLnlftq/ypLV3gadS5OeCY5rhY6sxpyZMVhKo8ncySUgdv6HtN
pzX2D7nwfUmFWlH7swvguJwNOVZMayGom6/2LKk6UJJgPSQCHSeS5UY+cB3hFUdN
QOLiKM3f6nMYjvAP0cK6cUHuKs1+K/6vjOMAy1MD4mbDZ44mVrmlkLpMg6YtTPY5
cxsPuoLwKB+rIiuf0DUkCM8HmNDMYyAf0aklxe+XcoB5HEJcHqq7Max77l5cOyqa
nlR07M3rU251wM1bqbM3vY/oTIMsqgrGhNLqMm2FkFgfSv7P0J+xefoD97+t2RFA
+s/mSXatbAqqRIjHnNsK4Eo0YNmgArXEhH5El6S+H1Vtz2M9ciN1MXTmWOAV9Frq
sZNsx82sEmjzzW08ztThRqdbsXN/u+a7REDr0ehpZIDVsYN+yXWIC2jRXiM4pYLD
x2GhiRazVQeUJ+fDD67MtPoHnsBzDyuiHWGi85/T6A2uvZk7qGaQaTXTgfiqWu/q
6/YiJ0JddhRy6ikb/IC1Uyz4cPby4bx7cJhiUVdFcKB8IhlGrvw=
=HfN1
-----END PGP SIGNATURE-----