Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 124878
b: refs/heads/master
c: cb4f0d1
h: refs/heads/master
v: v3
  • Loading branch information
Dave Chinner authored and Lachlan McIlroy committed Nov 10, 2008
1 parent b2a8612 commit 77fb9b1
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d44dab8d1cde8aeba1faf44a7654f90800feb7fc
refs/heads/master: cb4f0d1d4229f609f43c68acec69c7618ed72397
42 changes: 24 additions & 18 deletions trunk/fs/xfs/quota/xfs_qm_syscalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -1036,9 +1036,6 @@ xfs_qm_dqrele_inodes_ag(
int nr_found;

do {
boolean_t inode_refed;
struct inode *inode;

/*
* use a gang lookup to find the next inode in the tree
* as the tree is sparse and a gang lookup walks to find
Expand All @@ -1053,27 +1050,37 @@ xfs_qm_dqrele_inodes_ag(
break;
}

/* update the index for the next lookup */
/*
* Update the index for the next lookup. Catch overflows
* into the next AG range which can occur if we have inodes
* in the last block of the AG and we are currently
* pointing to the last inode.
*/
first_index = XFS_INO_TO_AGINO(mp, ip->i_ino + 1);
if (first_index < XFS_INO_TO_AGINO(mp, ip->i_ino)) {
read_unlock(&pag->pag_ici_lock);
break;
}

/* skip quota inodes and those in reclaim */
inode = VFS_I(ip);
if (!inode || ip == XFS_QI_UQIP(mp) || ip == XFS_QI_GQIP(mp)) {
/* skip quota inodes */
if (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) {
inode = igrab(inode);
read_unlock(&pag->pag_ici_lock);
if (!inode)
continue;
inode_refed = B_TRUE;
xfs_ilock(ip, XFS_ILOCK_EXCL);
} else {

/*
* If we can't get a reference on the inode, it must be
* in reclaim. Leave it for the reclaim code to flush.
*/
if (!igrab(VFS_I(ip))) {
read_unlock(&pag->pag_ici_lock);
continue;
}
read_unlock(&pag->pag_ici_lock);

xfs_ilock(ip, XFS_ILOCK_EXCL);
if ((flags & XFS_UQUOTA_ACCT) && ip->i_udquot) {
xfs_qm_dqrele(ip->i_udquot);
ip->i_udquot = NULL;
Expand All @@ -1083,9 +1090,8 @@ xfs_qm_dqrele_inodes_ag(
xfs_qm_dqrele(ip->i_gdquot);
ip->i_gdquot = NULL;
}
xfs_iunlock(ip, XFS_ILOCK_EXCL);
if (inode_refed)
IRELE(ip);
xfs_iput(ip, XFS_ILOCK_EXCL);

} while (nr_found);
}

Expand Down

0 comments on commit 77fb9b1

Please sign in to comment.