MCPcopy Create free account
hub / github.com/F-Stack/f-stack / cache_purgevfs

Function cache_purgevfs

freebsd/kern/vfs_cache.c:2817–2837  ·  view source on GitHub ↗

* Flush all entries referencing a particular filesystem. */

Source from the content-addressed store, hash-verified

2815 * Flush all entries referencing a particular filesystem.
2816 */
2817void
2818cache_purgevfs(struct mount *mp)
2819{
2820 struct vnode *vp, *mvp;
2821
2822 SDT_PROBE1(vfs, namecache, purgevfs, done, mp);
2823 /*
2824 * Somewhat wasteful iteration over all vnodes. Would be better to
2825 * support filtering and avoid the interlock to begin with.
2826 */
2827 MNT_VNODE_FOREACH_ALL(vp, mp, mvp) {
2828 if (!cache_has_entries(vp)) {
2829 VI_UNLOCK(vp);
2830 continue;
2831 }
2832 vholdl(vp);
2833 VI_UNLOCK(vp);
2834 cache_purge(vp);
2835 vdrop(vp);
2836 }
2837}
2838
2839/*
2840 * Perform canonical checks and cache lookup and pass on to filesystem

Callers 2

zfsvfs_teardownFunction · 0.85
vfs_mountroot_shuffleFunction · 0.85

Calls 3

cache_has_entriesFunction · 0.85
cache_purgeFunction · 0.85
vdropFunction · 0.85

Tested by

no test coverage detected