=========================================================================== Index: linux/fs/xfs/linux/xfs_super.c =========================================================================== --- /usr/tmp/TmpDir.7400-0/linux/fs/xfs/linux/xfs_super.c_1.161 Wed Mar 6 13:11:35 2002 +++ linux/fs/xfs/linux/xfs_super.c Tue Mar 5 04:54:59 2002 @@ -606,6 +606,7 @@ vnode_t *vp = LINVFS_GET_VP(inode); if (vp) { + vn_rele(vp); vn_trace_entry(vp, "linvfs_delete_inode", (inst_t *)__return_address); /* @@ -626,6 +627,7 @@ vnode_t *vp = LINVFS_GET_VP(inode); if (vp) { + vn_rele(vp); vn_trace_entry(vp, "linvfs_clear_inode", (inst_t *)__return_address); /* @@ -638,11 +640,13 @@ void linvfs_put_inode( - struct inode *inode) + struct inode *ip) { - vnode_t *vp = LINVFS_GET_VP(inode); + vnode_t *vp = LINVFS_GET_VP(ip); + int error; - if (vp) vn_put(vp); + if (vp && (atomic_read(&ip->i_count) == 1)) + VOP_RELEASE(vp, error); } void =========================================================================== Index: linux/fs/xfs/linux/xfs_vnode.c =========================================================================== --- /usr/tmp/TmpDir.7400-0/linux/fs/xfs/linux/xfs_vnode.c_1.69 Wed Mar 6 13:11:35 2002 +++ linux/fs/xfs/linux/xfs_vnode.c Tue Mar 5 04:42:15 2002 @@ -224,29 +224,6 @@ } /* - * Free an isolated vnode. - * The vnode must not have any other references. - */ -void -vn_free(struct vnode *vp) -{ - struct inode *inode; - - XFS_STATS_INC(xfsstats.vn_free); - - vn_trace_entry(vp, "vn_free", (inst_t *)__return_address); - - ASSERT(vn_count(vp) == 1); - - ASSERT((vp->v_flag & VPURGE) == 0); - vp->v_fbhv = NULL; - inode = LINVFS_GET_IP(vp); - inode->i_sb = NULL; - iput(inode); -} - - -/* * Get a reference on a vnode. */ vnode_t * @@ -276,25 +253,6 @@ return vp; } - -/* - * "Temporary" routine to return the linux inode - * hold count, after everybody else can directly - * reference the inode (header magic!), this - * routine is dead meat.. - */ -int -vn_count(struct vnode *vp) -{ - struct inode *inode; - - inode = LINVFS_GET_IP(vp); - - ASSERT(inode); - - return atomic_read(&inode->i_count); -} - /* * "revalidate" the linux inode. */ @@ -439,19 +397,10 @@ } /* - * Release a vnode. - */ -void -vn_rele(struct vnode *vp) -{ - iput(LINVFS_GET_IP(vp)); -} - -/* * Call VOP_INACTIVE on last reference. */ void -vn_put(struct vnode *vp) +vn_rele(struct vnode *vp) { int s; int vcnt; @@ -473,7 +422,7 @@ * that i_count won't be decremented after we * return. */ - if (vcnt == 1) { + if (vcnt == 0) { /* * It is absolutely, positively the case that * the lock manager will not be releasing vnodes =========================================================================== Index: linux/fs/xfs/linux/xfs_vnode.h =========================================================================== --- /usr/tmp/TmpDir.7400-0/linux/fs/xfs/linux/xfs_vnode.h_1.26 Wed Mar 6 13:11:35 2002 +++ linux/fs/xfs/linux/xfs_vnode.h Sun Mar 3 18:04:15 2002 @@ -719,7 +719,6 @@ * incremented to define a new vnode epoch. */ extern void vn_init(void); -extern void vn_free(struct vnode *); extern int vn_wait(struct vnode *); extern vnode_t *vn_address(struct inode *); extern vnode_t *vn_initialize(struct vfs *, struct inode *, int); @@ -750,12 +749,18 @@ #define VMAP(vp, ip, vmap) {(vmap).v_vfsp = (vp)->v_vfsp, \ (vmap).v_number = (vp)->v_number, \ (vmap).v_ino = (ip)->i_ino; } -extern int vn_count(struct vnode *); extern void vn_purge(struct vnode *, vmap_t *); extern vnode_t *vn_get(struct vnode *, vmap_t *, uint); extern int vn_revalidate(struct vnode *, int); extern void vn_remove(struct vnode *); +static inline int vn_count(struct vnode *vp) +{ + struct inode *ip = LINVFS_GET_IP(vp); + + return atomic_read(&ip->i_count); +} + /* * Flags for vn_get(). */ @@ -766,7 +771,6 @@ */ extern vnode_t *vn_hold(struct vnode *); extern void vn_rele(struct vnode *); -extern void vn_put(struct vnode *); #if defined(CONFIG_XFS_VNODE_TRACING) @@ -775,12 +779,12 @@ vn_trace_hold(vp, __FILE__, __LINE__, (inst_t *)__return_address)) #define VN_RELE(vp) \ (vn_trace_rele(vp, __FILE__, __LINE__, (inst_t *)__return_address), \ - vn_rele(vp)) + iput(LINVFS_GET_IP(vp))) #else /* ! (defined(CONFIG_XFS_VNODE_TRACING)) */ #define VN_HOLD(vp) ((void)vn_hold(vp)) -#define VN_RELE(vp) (vn_rele(vp)) +#define VN_RELE(vp) (iput(LINVFS_GET_IP(vp))) #endif /* ! (defined(CONFIG_XFS_VNODE_TRACING) */