@@ -26,6 +26,11 @@
#include <linux/iversion.h>
+/*
+ * flags for incore inode iterator
+ */
+#define XFS_INODE_WALK_INEW_WAIT 0x1 /* wait on new inodes */
+
/*
* Allocate and initialise an xfs_inode.
*/
@@ -888,8 +893,8 @@ xfs_inode_walk_get_perag(
* Call the @execute function on all incore inodes matching the radix tree
* @tag.
*/
-int
-xfs_inode_walk(
+STATIC int
+__xfs_inode_walk(
struct xfs_mount *mp,
int iter_flags,
int (*execute)(struct xfs_inode *ip, void *args),
@@ -915,6 +920,20 @@ xfs_inode_walk(
return last_error;
}
+/*
+ * Walk all incore inodes in the filesystem. Knowledge of radix tree tags
+ * is hidden and we always wait for INEW inodes.
+ */
+int
+xfs_inode_walk(
+ struct xfs_mount *mp,
+ int (*execute)(struct xfs_inode *ip, void *args),
+ void *args)
+{
+ return __xfs_inode_walk(mp, XFS_INODE_WALK_INEW_WAIT, execute, args,
+ XFS_ICI_NO_TAG);
+}
+
/*
* Background scanning to trim post-EOF preallocated space. This is queued
* based on the 'speculative_prealloc_lifetime' tunable (5m by default).
@@ -1392,7 +1411,7 @@ xfs_icache_free_eofblocks(
struct xfs_mount *mp,
struct xfs_eofblocks *eofb)
{
- return xfs_inode_walk(mp, 0, xfs_inode_free_eofblocks, eofb,
+ return __xfs_inode_walk(mp, 0, xfs_inode_free_eofblocks, eofb,
XFS_ICI_EOFBLOCKS_TAG);
}
@@ -1642,7 +1661,7 @@ xfs_icache_free_cowblocks(
struct xfs_mount *mp,
struct xfs_eofblocks *eofb)
{
- return xfs_inode_walk(mp, 0, xfs_inode_free_cowblocks, eofb,
+ return __xfs_inode_walk(mp, 0, xfs_inode_free_cowblocks, eofb,
XFS_ICI_COWBLOCKS_TAG);
}
@@ -34,11 +34,6 @@ struct xfs_eofblocks {
#define XFS_IGET_DONTCACHE 0x4
#define XFS_IGET_INCORE 0x8 /* don't read from disk or reinit */
-/*
- * flags for AG inode iterator
- */
-#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);
@@ -68,9 +63,9 @@ 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_walk(struct xfs_mount *mp, int iter_flags,
+int xfs_inode_walk(struct xfs_mount *mp,
int (*execute)(struct xfs_inode *ip, void *args),
- void *args, int tag);
+ void *args);
int xfs_icache_inode_is_allocated(struct xfs_mount *mp, struct xfs_trans *tp,
xfs_ino_t ino, bool *inuse);
@@ -795,6 +795,5 @@ xfs_qm_dqrele_all_inodes(
uint flags)
{
ASSERT(mp->m_quotainfo);
- xfs_inode_walk(mp, XFS_INODE_WALK_INEW_WAIT, xfs_dqrele_inode,
- &flags, XFS_ICI_NO_TAG);
+ xfs_inode_walk(mp, xfs_dqrele_inode, &flags);
}