Commit a437b9b4 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Darrick J. Wong

xfs: remove support for untagged lookups in xfs_icwalk*

With quotaoff not allowing disabling of accounting there is no need
for untagged lookups in this code, so remove the dead leftovers.
Repoted-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
[djwong: convert to for_each_perag_tag]
Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
parent 32816fd7
...@@ -43,15 +43,6 @@ enum xfs_icwalk_goal { ...@@ -43,15 +43,6 @@ enum xfs_icwalk_goal {
XFS_ICWALK_RECLAIM = XFS_ICI_RECLAIM_TAG, XFS_ICWALK_RECLAIM = XFS_ICI_RECLAIM_TAG,
}; };
#define XFS_ICWALK_NULL_TAG (-1U)
/* Compute the inode radix tree tag for this goal. */
static inline unsigned int
xfs_icwalk_tag(enum xfs_icwalk_goal goal)
{
return goal < 0 ? XFS_ICWALK_NULL_TAG : goal;
}
static int xfs_icwalk(struct xfs_mount *mp, static int xfs_icwalk(struct xfs_mount *mp,
enum xfs_icwalk_goal goal, struct xfs_icwalk *icw); enum xfs_icwalk_goal goal, struct xfs_icwalk *icw);
static int xfs_icwalk_ag(struct xfs_perag *pag, static int xfs_icwalk_ag(struct xfs_perag *pag,
...@@ -1676,22 +1667,14 @@ xfs_icwalk_ag( ...@@ -1676,22 +1667,14 @@ xfs_icwalk_ag(
nr_found = 0; nr_found = 0;
do { do {
struct xfs_inode *batch[XFS_LOOKUP_BATCH]; struct xfs_inode *batch[XFS_LOOKUP_BATCH];
unsigned int tag = xfs_icwalk_tag(goal);
int error = 0; int error = 0;
int i; int i;
rcu_read_lock(); rcu_read_lock();
if (tag == XFS_ICWALK_NULL_TAG) nr_found = radix_tree_gang_lookup_tag(&pag->pag_ici_root,
nr_found = radix_tree_gang_lookup(&pag->pag_ici_root, (void **) batch, first_index,
(void **)batch, first_index, XFS_LOOKUP_BATCH, goal);
XFS_LOOKUP_BATCH);
else
nr_found = radix_tree_gang_lookup_tag(
&pag->pag_ici_root,
(void **) batch, first_index,
XFS_LOOKUP_BATCH, tag);
if (!nr_found) { if (!nr_found) {
done = true; done = true;
rcu_read_unlock(); rcu_read_unlock();
...@@ -1769,20 +1752,6 @@ xfs_icwalk_ag( ...@@ -1769,20 +1752,6 @@ xfs_icwalk_ag(
return last_error; return last_error;
} }
/* Fetch the next (possibly tagged) per-AG structure. */
static inline struct xfs_perag *
xfs_icwalk_get_perag(
struct xfs_mount *mp,
xfs_agnumber_t agno,
enum xfs_icwalk_goal goal)
{
unsigned int tag = xfs_icwalk_tag(goal);
if (tag == XFS_ICWALK_NULL_TAG)
return xfs_perag_get(mp, agno);
return xfs_perag_get_tag(mp, agno, tag);
}
/* Walk all incore inodes to achieve a given goal. */ /* Walk all incore inodes to achieve a given goal. */
static int static int
xfs_icwalk( xfs_icwalk(
...@@ -1793,16 +1762,16 @@ xfs_icwalk( ...@@ -1793,16 +1762,16 @@ xfs_icwalk(
struct xfs_perag *pag; struct xfs_perag *pag;
int error = 0; int error = 0;
int last_error = 0; int last_error = 0;
xfs_agnumber_t agno = 0; xfs_agnumber_t agno;
while ((pag = xfs_icwalk_get_perag(mp, agno, goal))) { for_each_perag_tag(mp, agno, pag, goal) {
agno = pag->pag_agno + 1;
error = xfs_icwalk_ag(pag, goal, icw); error = xfs_icwalk_ag(pag, goal, icw);
xfs_perag_put(pag);
if (error) { if (error) {
last_error = error; last_error = error;
if (error == -EFSCORRUPTED) if (error == -EFSCORRUPTED) {
xfs_perag_put(pag);
break; break;
}
} }
} }
return last_error; return last_error;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment