diff options
author | Christoph Hellwig <hch@sgi.com> | 2005-09-05 08:23:54 +1000 |
---|---|---|
committer | Nathan Scott <nathans@sgi.com> | 2005-09-05 08:23:54 +1000 |
commit | 56d433e430eb399a4b6d0e73d28af6e1d4713547 (patch) | |
tree | d43aa8b457e52d80254e8c621b01ecc5b20d05ab /fs/xfs/linux-2.6/xfs_super.c | |
parent | c1a073bdff997216eac25254a2716faf640e4e8d (diff) | |
download | lwn-56d433e430eb399a4b6d0e73d28af6e1d4713547.tar.gz lwn-56d433e430eb399a4b6d0e73d28af6e1d4713547.zip |
[XFS] streamline the clear_inode path
SGI-PV: 940531
SGI-Modid: xfs-linux:xfs-kern:196888a
Signed-off-by: Christoph Hellwig <hch@sgi.com>
Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_super.c')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_super.c | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c index 1a0bcbbc0a86..9b40a2799f7e 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/linux-2.6/xfs_super.c @@ -383,17 +383,33 @@ linvfs_clear_inode( struct inode *inode) { vnode_t *vp = LINVFS_GET_VP(inode); + int error, cache; - if (vp) { - vn_rele(vp); - vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); - /* - * Do all our cleanup, and remove this vnode. - */ - vn_remove(vp); - } -} + vn_trace_entry(vp, "clear_inode", (inst_t *)__return_address); + + ASSERT(vp->v_fbhv != NULL); + + XFS_STATS_INC(vn_rele); + XFS_STATS_INC(vn_remove); + XFS_STATS_INC(vn_reclaim); + XFS_STATS_DEC(vn_active); + VOP_INACTIVE(vp, NULL, cache); + + VN_LOCK(vp); + vp->v_flag &= ~VMODIFIED; + VN_UNLOCK(vp, 0); + + VOP_RECLAIM(vp, error); + if (error) + panic("vn_purge: cannot reclaim"); + + ASSERT(vp->v_fbhv == NULL); + +#ifdef XFS_VNODE_TRACE + ktrace_free(vp->v_trace); +#endif +} /* * Enqueue a work item to be picked up by the vfs xfssyncd thread. |