Commit 15aac141 authored by Felix Blyakher's avatar Felix Blyakher Committed by Nathan Scott

[XFS] Removed xfs_iflush_all and all usages of vn_purge, except one

in clear_inode path.

SGI Modid: xfs-linux:xfs-kern:174683a
Signed-off-by: default avatarNathan Scott <nathans@sgi.com>
parent a763e524
...@@ -3579,108 +3579,6 @@ xfs_iflush_int( ...@@ -3579,108 +3579,6 @@ xfs_iflush_int(
return XFS_ERROR(EFSCORRUPTED); return XFS_ERROR(EFSCORRUPTED);
} }
/*
* Flush all inactive inodes in mp. Return true if no user references
* were found, false otherwise.
*/
int
xfs_iflush_all(
xfs_mount_t *mp,
int flag)
{
int busy;
int done;
int purged;
xfs_inode_t *ip;
vmap_t vmap;
vnode_t *vp;
busy = done = 0;
while (!done) {
purged = 0;
XFS_MOUNT_ILOCK(mp);
ip = mp->m_inodes;
if (ip == NULL) {
break;
}
do {
/* Make sure we skip markers inserted by sync */
if (ip->i_mount == NULL) {
ip = ip->i_mnext;
continue;
}
/*
* It's up to our caller to purge the root
* and quota vnodes later.
*/
vp = XFS_ITOV_NULL(ip);
if (!vp) {
XFS_MOUNT_IUNLOCK(mp);
xfs_finish_reclaim(ip, 0, XFS_IFLUSH_ASYNC);
purged = 1;
break;
}
if (vn_count(vp) != 0) {
if (vn_count(vp) == 1 &&
(ip == mp->m_rootip ||
(mp->m_quotainfo &&
(ip->i_ino == mp->m_sb.sb_uquotino ||
ip->i_ino == mp->m_sb.sb_gquotino)))) {
ip = ip->i_mnext;
continue;
}
if (!(flag & XFS_FLUSH_ALL)) {
ASSERT(0);
busy = 1;
done = 1;
break;
}
/*
* Ignore busy inodes but continue flushing
* others.
*/
ip = ip->i_mnext;
continue;
}
/*
* Sample vp mapping while holding mp locked on MP
* systems, so we don't purge a reclaimed or
* nonexistent vnode. We break from the loop
* since we know that we modify
* it by pulling ourselves from it in xfs_reclaim()
* called via vn_purge() below. Set ip to the next
* entry in the list anyway so we'll know below
* whether we reached the end or not.
*/
VMAP(vp, vmap);
XFS_MOUNT_IUNLOCK(mp);
vn_purge(vp, &vmap);
purged = 1;
break;
} while (ip != mp->m_inodes);
/*
* We need to distinguish between when we exit the loop
* after a purge and when we simply hit the end of the
* list. We can't use the (ip == mp->m_inodes) test,
* because when we purge an inode at the start of the list
* the next inode on the list becomes mp->m_inodes. That
* would cause such a test to bail out early. The purged
* variable tells us how we got out of the loop.
*/
if (!purged) {
done = 1;
}
}
XFS_MOUNT_IUNLOCK(mp);
return !busy;
}
/* /*
* xfs_iaccess: check accessibility of inode for mode. * xfs_iaccess: check accessibility of inode for mode.
......
...@@ -527,7 +527,6 @@ void xfs_ipin(xfs_inode_t *); ...@@ -527,7 +527,6 @@ void xfs_ipin(xfs_inode_t *);
void xfs_iunpin(xfs_inode_t *); void xfs_iunpin(xfs_inode_t *);
int xfs_iextents_copy(xfs_inode_t *, xfs_bmbt_rec_t *, int); int xfs_iextents_copy(xfs_inode_t *, xfs_bmbt_rec_t *, int);
int xfs_iflush(xfs_inode_t *, uint); int xfs_iflush(xfs_inode_t *, uint);
int xfs_iflush_all(struct xfs_mount *, int);
int xfs_iaccess(xfs_inode_t *, mode_t, cred_t *); int xfs_iaccess(xfs_inode_t *, mode_t, cred_t *);
uint xfs_iroundup(uint); uint xfs_iroundup(uint);
void xfs_ichgtime(xfs_inode_t *, int); void xfs_ichgtime(xfs_inode_t *, int);
......
...@@ -635,7 +635,6 @@ xfs_mountfs( ...@@ -635,7 +635,6 @@ xfs_mountfs(
xfs_inode_t *rip; xfs_inode_t *rip;
vnode_t *rvp = 0; vnode_t *rvp = 0;
int readio_log, writeio_log; int readio_log, writeio_log;
vmap_t vmap;
xfs_daddr_t d; xfs_daddr_t d;
__uint64_t ret64; __uint64_t ret64;
__int64_t update_flags; __int64_t update_flags;
...@@ -979,7 +978,6 @@ xfs_mountfs( ...@@ -979,7 +978,6 @@ xfs_mountfs(
ASSERT(rip != NULL); ASSERT(rip != NULL);
rvp = XFS_ITOV(rip); rvp = XFS_ITOV(rip);
VMAP(rvp, vmap);
if (unlikely((rip->i_d.di_mode & S_IFMT) != S_IFDIR)) { if (unlikely((rip->i_d.di_mode & S_IFMT) != S_IFDIR)) {
cmn_err(CE_WARN, "XFS: corrupted root inode"); cmn_err(CE_WARN, "XFS: corrupted root inode");
...@@ -1043,7 +1041,6 @@ xfs_mountfs( ...@@ -1043,7 +1041,6 @@ xfs_mountfs(
* Free up the root inode. * Free up the root inode.
*/ */
VN_RELE(rvp); VN_RELE(rvp);
vn_purge(rvp, &vmap);
error3: error3:
xfs_log_unmount_dealloc(mp); xfs_log_unmount_dealloc(mp);
error2: error2:
...@@ -1077,8 +1074,6 @@ xfs_unmountfs(xfs_mount_t *mp, struct cred *cr) ...@@ -1077,8 +1074,6 @@ xfs_unmountfs(xfs_mount_t *mp, struct cred *cr)
int64_t fsid; int64_t fsid;
#endif #endif
xfs_iflush_all(mp, XFS_FLUSH_ALL);
XFS_QM_DQPURGEALL(mp, XFS_QM_DQPURGEALL(mp,
XFS_QMOPT_UQUOTA | XFS_QMOPT_GQUOTA | XFS_QMOPT_UMOUNTING); XFS_QMOPT_UQUOTA | XFS_QMOPT_GQUOTA | XFS_QMOPT_UMOUNTING);
......
...@@ -2353,13 +2353,7 @@ xfs_rtmount_inodes( ...@@ -2353,13 +2353,7 @@ xfs_rtmount_inodes(
ASSERT(sbp->sb_rsumino != NULLFSINO); ASSERT(sbp->sb_rsumino != NULLFSINO);
error = xfs_iget(mp, NULL, sbp->sb_rsumino, 0, &mp->m_rsumip, 0); error = xfs_iget(mp, NULL, sbp->sb_rsumino, 0, &mp->m_rsumip, 0);
if (error) { if (error) {
vnode_t *rbmvp; /* vnode for bitmap file */ VN_RELE(XFS_ITOV(mp->m_rbmip));
vmap_t vmap; /* vmap to delete vnode */
rbmvp = XFS_ITOV(mp->m_rbmip);
VMAP(rbmvp, vmap);
VN_RELE(rbmvp);
vn_purge(rbmvp, &vmap);
return error; return error;
} }
ASSERT(mp->m_rsumip != NULL); ASSERT(mp->m_rsumip != NULL);
......
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