xfs: split out inode walk inode grabbing
When doing read side inode cache walks, the code to validate and grab an inode is common to all callers. Split it out of the execute callbacks in preparation for batching lookups. Similarly, split out the inode reference dropping from the execute callbacks into the main lookup look to be symmetric with the grab. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Alex Elder <aelder@sgi.com>
This commit is contained in:
@@ -875,21 +875,14 @@ xfs_dqrele_inode(
|
||||
struct xfs_perag *pag,
|
||||
int flags)
|
||||
{
|
||||
int error;
|
||||
|
||||
/* skip quota inodes */
|
||||
if (ip == ip->i_mount->m_quotainfo->qi_uquotaip ||
|
||||
ip == ip->i_mount->m_quotainfo->qi_gquotaip) {
|
||||
ASSERT(ip->i_udquot == NULL);
|
||||
ASSERT(ip->i_gdquot == NULL);
|
||||
read_unlock(&pag->pag_ici_lock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
error = xfs_sync_inode_valid(ip, pag);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
xfs_ilock(ip, XFS_ILOCK_EXCL);
|
||||
if ((flags & XFS_UQUOTA_ACCT) && ip->i_udquot) {
|
||||
xfs_qm_dqrele(ip->i_udquot);
|
||||
@@ -900,8 +893,6 @@ xfs_dqrele_inode(
|
||||
ip->i_gdquot = NULL;
|
||||
}
|
||||
xfs_iunlock(ip, XFS_ILOCK_EXCL);
|
||||
|
||||
IRELE(ip);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user