|
@@ -90,14 +90,13 @@ xfs_inode_ag_lookup(
|
|
STATIC int
|
|
STATIC int
|
|
xfs_inode_ag_walk(
|
|
xfs_inode_ag_walk(
|
|
struct xfs_mount *mp,
|
|
struct xfs_mount *mp,
|
|
- xfs_agnumber_t ag,
|
|
|
|
|
|
+ struct xfs_perag *pag,
|
|
int (*execute)(struct xfs_inode *ip,
|
|
int (*execute)(struct xfs_inode *ip,
|
|
struct xfs_perag *pag, int flags),
|
|
struct xfs_perag *pag, int flags),
|
|
int flags,
|
|
int flags,
|
|
int tag,
|
|
int tag,
|
|
int exclusive)
|
|
int exclusive)
|
|
{
|
|
{
|
|
- struct xfs_perag *pag = &mp->m_perag[ag];
|
|
|
|
uint32_t first_index;
|
|
uint32_t first_index;
|
|
int last_error = 0;
|
|
int last_error = 0;
|
|
int skipped;
|
|
int skipped;
|
|
@@ -141,8 +140,6 @@ restart:
|
|
delay(1);
|
|
delay(1);
|
|
goto restart;
|
|
goto restart;
|
|
}
|
|
}
|
|
-
|
|
|
|
- xfs_put_perag(mp, pag);
|
|
|
|
return last_error;
|
|
return last_error;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -160,10 +157,16 @@ xfs_inode_ag_iterator(
|
|
xfs_agnumber_t ag;
|
|
xfs_agnumber_t ag;
|
|
|
|
|
|
for (ag = 0; ag < mp->m_sb.sb_agcount; ag++) {
|
|
for (ag = 0; ag < mp->m_sb.sb_agcount; ag++) {
|
|
- if (!mp->m_perag[ag].pag_ici_init)
|
|
|
|
|
|
+ struct xfs_perag *pag;
|
|
|
|
+
|
|
|
|
+ pag = xfs_perag_get(mp, ag);
|
|
|
|
+ if (!pag->pag_ici_init) {
|
|
|
|
+ xfs_perag_put(pag);
|
|
continue;
|
|
continue;
|
|
- error = xfs_inode_ag_walk(mp, ag, execute, flags, tag,
|
|
|
|
|
|
+ }
|
|
|
|
+ error = xfs_inode_ag_walk(mp, pag, execute, flags, tag,
|
|
exclusive);
|
|
exclusive);
|
|
|
|
+ xfs_perag_put(pag);
|
|
if (error) {
|
|
if (error) {
|
|
last_error = error;
|
|
last_error = error;
|
|
if (error == EFSCORRUPTED)
|
|
if (error == EFSCORRUPTED)
|
|
@@ -690,16 +693,17 @@ void
|
|
xfs_inode_set_reclaim_tag(
|
|
xfs_inode_set_reclaim_tag(
|
|
xfs_inode_t *ip)
|
|
xfs_inode_t *ip)
|
|
{
|
|
{
|
|
- xfs_mount_t *mp = ip->i_mount;
|
|
|
|
- xfs_perag_t *pag = xfs_get_perag(mp, ip->i_ino);
|
|
|
|
|
|
+ struct xfs_mount *mp = ip->i_mount;
|
|
|
|
+ struct xfs_perag *pag;
|
|
|
|
|
|
|
|
+ pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ip->i_ino));
|
|
read_lock(&pag->pag_ici_lock);
|
|
read_lock(&pag->pag_ici_lock);
|
|
spin_lock(&ip->i_flags_lock);
|
|
spin_lock(&ip->i_flags_lock);
|
|
__xfs_inode_set_reclaim_tag(pag, ip);
|
|
__xfs_inode_set_reclaim_tag(pag, ip);
|
|
__xfs_iflags_set(ip, XFS_IRECLAIMABLE);
|
|
__xfs_iflags_set(ip, XFS_IRECLAIMABLE);
|
|
spin_unlock(&ip->i_flags_lock);
|
|
spin_unlock(&ip->i_flags_lock);
|
|
read_unlock(&pag->pag_ici_lock);
|
|
read_unlock(&pag->pag_ici_lock);
|
|
- xfs_put_perag(mp, pag);
|
|
|
|
|
|
+ xfs_perag_put(pag);
|
|
}
|
|
}
|
|
|
|
|
|
void
|
|
void
|