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

Function __mnt_vnode_next_all

freebsd/kern/vfs_subr.c:6555–6586  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6553 */
6554
6555struct vnode *
6556__mnt_vnode_next_all(struct vnode **mvp, struct mount *mp)
6557{
6558 struct vnode *vp;
6559
6560 if (should_yield())
6561 kern_yield(PRI_USER);
6562 MNT_ILOCK(mp);
6563 KASSERT((*mvp)->v_mount == mp, ("marker vnode mount list mismatch"));
6564 for (vp = TAILQ_NEXT(*mvp, v_nmntvnodes); vp != NULL;
6565 vp = TAILQ_NEXT(vp, v_nmntvnodes)) {
6566 /* Allow a racy peek at VIRF_DOOMED to save a lock acquisition. */
6567 if (vp->v_type == VMARKER || VN_IS_DOOMED(vp))
6568 continue;
6569 VI_LOCK(vp);
6570 if (VN_IS_DOOMED(vp)) {
6571 VI_UNLOCK(vp);
6572 continue;
6573 }
6574 break;
6575 }
6576 if (vp == NULL) {
6577 __mnt_vnode_markerfree_all(mvp, mp);
6578 /* MNT_IUNLOCK(mp); -- done in above function */
6579 mtx_assert(MNT_MTX(mp), MA_NOTOWNED);
6580 return (NULL);
6581 }
6582 TAILQ_REMOVE(&mp->mnt_nvnodelist, *mvp, v_nmntvnodes);
6583 TAILQ_INSERT_AFTER(&mp->mnt_nvnodelist, vp, *mvp, v_nmntvnodes);
6584 MNT_IUNLOCK(mp);
6585 return (vp);
6586}
6587
6588struct vnode *
6589__mnt_vnode_first_all(struct vnode **mvp, struct mount *mp)

Callers

nothing calls this directly

Calls 4

should_yieldFunction · 0.85
mtx_assertFunction · 0.85
kern_yieldFunction · 0.70

Tested by

no test coverage detected