Correct a reference-counting mistake in the ZFS code which led to abnormal
memory usage and pessimal cache performance. Reviewed by: pjd Approved by: re (rwatson)
This commit is contained in:
parent
f616cf330e
commit
2dc26b36c8
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=171316
@ -3493,7 +3493,7 @@ zfs_freebsd_reclaim(ap)
|
||||
rele = 0;
|
||||
vp->v_data = NULL;
|
||||
ASSERT(vp->v_holdcnt > 1);
|
||||
vdropl(vp);
|
||||
VI_UNLOCK(vp);
|
||||
if (!zp->z_unlinked && rele)
|
||||
VFS_RELE(zfsvfs->z_vfs);
|
||||
return (0);
|
||||
|
@ -115,7 +115,6 @@ zfs_znode_cache_constructor(void *buf, void *cdrarg, int kmflags)
|
||||
ASSERT(error == 0);
|
||||
zp->z_vnode = vp;
|
||||
vp->v_data = (caddr_t)zp;
|
||||
vhold(vp);
|
||||
vp->v_vnlock->lk_flags |= LK_CANRECURSE;
|
||||
vp->v_vnlock->lk_flags &= ~LK_NOSHARE;
|
||||
} else {
|
||||
@ -601,7 +600,6 @@ zfs_zget(zfsvfs_t *zfsvfs, uint64_t obj_num, znode_t **zpp)
|
||||
ASSERT(err == 0);
|
||||
vp = ZTOV(zp);
|
||||
vp->v_data = (caddr_t)zp;
|
||||
vhold(vp);
|
||||
vp->v_vnlock->lk_flags |= LK_CANRECURSE;
|
||||
vp->v_vnlock->lk_flags &= ~LK_NOSHARE;
|
||||
vp->v_type = IFTOVT((mode_t)zp->z_phys->zp_mode);
|
||||
|
@ -3493,7 +3493,7 @@ zfs_freebsd_reclaim(ap)
|
||||
rele = 0;
|
||||
vp->v_data = NULL;
|
||||
ASSERT(vp->v_holdcnt > 1);
|
||||
vdropl(vp);
|
||||
VI_UNLOCK(vp);
|
||||
if (!zp->z_unlinked && rele)
|
||||
VFS_RELE(zfsvfs->z_vfs);
|
||||
return (0);
|
||||
|
@ -115,7 +115,6 @@ zfs_znode_cache_constructor(void *buf, void *cdrarg, int kmflags)
|
||||
ASSERT(error == 0);
|
||||
zp->z_vnode = vp;
|
||||
vp->v_data = (caddr_t)zp;
|
||||
vhold(vp);
|
||||
vp->v_vnlock->lk_flags |= LK_CANRECURSE;
|
||||
vp->v_vnlock->lk_flags &= ~LK_NOSHARE;
|
||||
} else {
|
||||
@ -601,7 +600,6 @@ zfs_zget(zfsvfs_t *zfsvfs, uint64_t obj_num, znode_t **zpp)
|
||||
ASSERT(err == 0);
|
||||
vp = ZTOV(zp);
|
||||
vp->v_data = (caddr_t)zp;
|
||||
vhold(vp);
|
||||
vp->v_vnlock->lk_flags |= LK_CANRECURSE;
|
||||
vp->v_vnlock->lk_flags &= ~LK_NOSHARE;
|
||||
vp->v_type = IFTOVT((mode_t)zp->z_phys->zp_mode);
|
||||
|
Loading…
Reference in New Issue
Block a user