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

Function tun_busy_locked

freebsd/net/if_tuntap.c:346–363  ·  view source on GitHub ↗

* Mechanism for marking a tunnel device as busy so that we can safely do some * orthogonal operations (such as operations on devices) without racing against * tun_destroy. tun_destroy will wait on the condvar if we're at all busy or * open, to be woken up when the condition is alleviated. */

Source from the content-addressed store, hash-verified

344 * open, to be woken up when the condition is alleviated.
345 */
346static int
347tun_busy_locked(struct tuntap_softc *tp)
348{
349
350 TUN_LOCK_ASSERT(tp);
351 if ((tp->tun_flags & TUN_DYING) != 0) {
352 /*
353 * Perhaps unintuitive, but the device is busy going away.
354 * Other interpretations of EBUSY from tun_busy make little
355 * sense, since making a busy device even more busy doesn't
356 * sound like a problem.
357 */
358 return (EBUSY);
359 }
360
361 ++tp->tun_busy;
362 return (0);
363}
364
365static void
366tun_unbusy_locked(struct tuntap_softc *tp)

Callers 2

tun_busyFunction · 0.85
tunopenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected