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

Function vfs_getvfs

freebsd/kern/vfs_subr.c:836–853  ·  view source on GitHub ↗

* Lookup a mount point by filesystem identifier. */

Source from the content-addressed store, hash-verified

834 * Lookup a mount point by filesystem identifier.
835 */
836struct mount *
837vfs_getvfs(fsid_t *fsid)
838{
839 struct mount *mp;
840
841 CTR2(KTR_VFS, "%s: fsid %p", __func__, fsid);
842 mtx_lock(&mountlist_mtx);
843 TAILQ_FOREACH(mp, &mountlist, mnt_list) {
844 if (fsidcmp(&mp->mnt_stat.f_fsid, fsid) == 0) {
845 vfs_ref(mp);
846 mtx_unlock(&mountlist_mtx);
847 return (mp);
848 }
849 }
850 mtx_unlock(&mountlist_mtx);
851 CTR2(KTR_VFS, "%s: lookup failed for %p id", __func__, fsid);
852 return ((struct mount *) 0);
853}
854
855/*
856 * Lookup a mount point by filesystem identifier, busying it before

Callers 2

vfs_getnewfsidFunction · 0.85
sysctl_vfs_ctlFunction · 0.85

Calls 3

vfs_refFunction · 0.85
mtx_lockFunction · 0.70
mtx_unlockFunction · 0.70

Tested by

no test coverage detected