aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/vnode.h
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2020-08-04 23:04:29 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2020-08-04 23:04:29 +0000
commit6e10434c0235f65b530de51cc636855bcada1cee (patch)
treed68ad28ee07f3188acb00fb5d8e7d44db03ebcd6 /sys/sys/vnode.h
parentbd66a0750f7ad8c13d4904fa976a03601a560cbf (diff)
downloadsrc-6e10434c0235f65b530de51cc636855bcada1cee.tar.gz
src-6e10434c0235f65b530de51cc636855bcada1cee.zip
cache: add cache_purge_vgone
cache_purge locklessly checks whether the vnode at hand has any namecache entries. This can race with a concurrent purge which managed to remove the last entry, but may not be done touching the vnode. Make sure we observe the relevant vnode lock as not taken before proceeding with vgone. Paired with the fact that doomed vnodes cannnot receive entries this restores the invariant that there are no namecache-related writing users past cache_purge in vgone. Reported by: pho
Notes
Notes: svn path=/head/; revision=363872
Diffstat (limited to 'sys/sys/vnode.h')
-rw-r--r--sys/sys/vnode.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
index bed5c0f4086f..f754b2b52724 100644
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -638,6 +638,7 @@ int cache_lookup(struct vnode *dvp, struct vnode **vpp,
struct componentname *cnp, struct timespec *tsp, int *ticksp);
void cache_vnode_init(struct vnode *vp);
void cache_purge(struct vnode *vp);
+void cache_purge_vgone(struct vnode *vp);
void cache_purge_negative(struct vnode *vp);
void cache_purgevfs(struct mount *mp, bool force);
int change_dir(struct vnode *vp, struct thread *td);