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

Function vfs_cache_root

freebsd/kern/vfs_subr.c:6498–6521  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6496}
6497
6498int
6499vfs_cache_root(struct mount *mp, int flags, struct vnode **vpp)
6500{
6501 struct mount_pcpu *mpcpu;
6502 struct vnode *vp;
6503 int error;
6504
6505 if (!vfs_op_thread_enter(mp, mpcpu))
6506 return (vfs_cache_root_fallback(mp, flags, vpp));
6507 vp = atomic_load_ptr(&mp->mnt_rootvnode);
6508 if (vp == NULL || VN_IS_DOOMED(vp)) {
6509 vfs_op_thread_exit(mp, mpcpu);
6510 return (vfs_cache_root_fallback(mp, flags, vpp));
6511 }
6512 vrefact(vp);
6513 vfs_op_thread_exit(mp, mpcpu);
6514 error = vn_lock(vp, flags);
6515 if (error != 0) {
6516 vrele(vp);
6517 return (vfs_cache_root_fallback(mp, flags, vpp));
6518 }
6519 *vpp = vp;
6520 return (0);
6521}
6522
6523struct vnode *
6524vfs_cache_root_clear(struct mount *mp)

Callers

nothing calls this directly

Calls 4

vfs_cache_root_fallbackFunction · 0.85
vn_lockFunction · 0.85
vrefactFunction · 0.70
vreleFunction · 0.70

Tested by

no test coverage detected