[XFS] Use struct inodes instead of vnodes to kill vn_grab

With the sync code relocated to the linux-2.6 directory we can use struct
inodes directly. If we do the same thing for the quota release code, we
can remove vn_grab altogether. While here, convert the VN_BAD() checks to
is_bad_inode() so we can remove vnodes entirely from this code.

SGI-PV: 988140

SGI-Modid: xfs-linux-melb:xfs-kern:32304a

Signed-off-by: David Chinner <david@fromorbit.com>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Signed-off-by: Christoph Hellwig <hch@infradead.org>
This commit is contained in:
David Chinner
2008-10-30 17:15:03 +11:00
committed by Lachlan McIlroy
parent 2af75df7be
commit bc60a99323
4 changed files with 37 additions and 43 deletions

View File

@@ -1031,13 +1031,13 @@ xfs_qm_dqrele_inodes_ag(
uint flags)
{
xfs_inode_t *ip = NULL;
struct inode *vp = NULL;
xfs_perag_t *pag = &mp->m_perag[ag];
int first_index = 0;
int nr_found;
do {
boolean_t vnode_refd = B_FALSE;
boolean_t inode_refed;
struct inode *inode;
/*
* use a gang lookup to find the next inode in the tree
@@ -1057,19 +1057,19 @@ xfs_qm_dqrele_inodes_ag(
first_index = XFS_INO_TO_AGINO(mp, ip->i_ino + 1);
/* skip quota inodes and those in reclaim */
vp = VFS_I(ip);
if (!vp || ip == XFS_QI_UQIP(mp) || ip == XFS_QI_GQIP(mp)) {
inode = VFS_I(ip);
if (!inode || ip == XFS_QI_UQIP(mp) || ip == XFS_QI_GQIP(mp)) {
ASSERT(ip->i_udquot == NULL);
ASSERT(ip->i_gdquot == NULL);
read_unlock(&pag->pag_ici_lock);
continue;
}
if (xfs_ilock_nowait(ip, XFS_ILOCK_EXCL) == 0) {
vp = vn_grab(vp);
inode = igrab(inode);
read_unlock(&pag->pag_ici_lock);
if (!vp)
if (!inode)
continue;
vnode_refd = B_TRUE;
inode_refed = B_TRUE;
xfs_ilock(ip, XFS_ILOCK_EXCL);
} else {
read_unlock(&pag->pag_ici_lock);
@@ -1084,7 +1084,7 @@ xfs_qm_dqrele_inodes_ag(
ip->i_gdquot = NULL;
}
xfs_iunlock(ip, XFS_ILOCK_EXCL);
if (vnode_refd)
if (inode_refed)
IRELE(ip);
} while (nr_found);
}