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

Function vdropl_final

freebsd/kern/vfs_subr.c:3553–3578  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3551}
3552
3553static void __noinline
3554vdropl_final(struct vnode *vp)
3555{
3556
3557 ASSERT_VI_LOCKED(vp, __func__);
3558 VNPASS(VN_IS_DOOMED(vp), vp);
3559 /*
3560 * Set the VHOLD_NO_SMR flag.
3561 *
3562 * We may be racing against vhold_smr. If they win we can just pretend
3563 * we never got this far, they will vdrop later.
3564 */
3565 if (__predict_false(!atomic_cmpset_int(&vp->v_holdcnt, 0, VHOLD_NO_SMR))) {
3566 vn_freevnodes_inc();
3567 VI_UNLOCK(vp);
3568 /*
3569 * We lost the aforementioned race. Any subsequent access is
3570 * invalid as they might have managed to vdropl on their own.
3571 */
3572 return;
3573 }
3574 /*
3575 * Don't bump freevnodes as this one is going away.
3576 */
3577 freevnode(vp);
3578}
3579
3580void
3581vdrop(struct vnode *vp)

Callers 1

vdroplFunction · 0.85

Calls 2

vn_freevnodes_incFunction · 0.85
freevnodeFunction · 0.85

Tested by

no test coverage detected