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

Function vfs_check_usecounts

freebsd/kern/vfs_mount.c:1485–1501  ·  view source on GitHub ↗

* Return error if any of the vnodes, ignoring the root vnode * and the syncer vnode, have non-zero usecount. * * This function is purely advisory - it can return false positives * and negatives. */

Source from the content-addressed store, hash-verified

1483 * and negatives.
1484 */
1485static int
1486vfs_check_usecounts(struct mount *mp)
1487{
1488 struct vnode *vp, *mvp;
1489
1490 MNT_VNODE_FOREACH_ALL(vp, mp, mvp) {
1491 if ((vp->v_vflag & VV_ROOT) == 0 && vp->v_type != VNON &&
1492 vp->v_usecount != 0) {
1493 VI_UNLOCK(vp);
1494 MNT_VNODE_FOREACH_ALL_ABORT(mp, mvp);
1495 return (EBUSY);
1496 }
1497 VI_UNLOCK(vp);
1498 }
1499
1500 return (0);
1501}
1502
1503static void
1504dounmount_cleanup(struct mount *mp, struct vnode *coveredvp, int mntkflags)

Callers 1

dounmountFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected