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

Function unp_process_defers

freebsd/kern/uipc_usrreq.c:2493–2518  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2491}
2492
2493static void
2494unp_process_defers(void *arg __unused, int pending)
2495{
2496 struct unp_defer *dr;
2497 SLIST_HEAD(, unp_defer) drl;
2498 int count;
2499
2500 SLIST_INIT(&drl);
2501 for (;;) {
2502 UNP_DEFERRED_LOCK();
2503 if (SLIST_FIRST(&unp_defers) == NULL) {
2504 UNP_DEFERRED_UNLOCK();
2505 break;
2506 }
2507 SLIST_SWAP(&unp_defers, &drl, unp_defer);
2508 UNP_DEFERRED_UNLOCK();
2509 count = 0;
2510 while ((dr = SLIST_FIRST(&drl)) != NULL) {
2511 SLIST_REMOVE_HEAD(&drl, ud_link);
2512 closef_nothread(dr->ud_fp);
2513 free(dr, M_TEMP);
2514 count++;
2515 }
2516 atomic_add_int(&unp_defers_count, -count);
2517 }
2518}
2519
2520static void
2521unp_internalize_fp(struct file *fp)

Callers

nothing calls this directly

Calls 2

closef_nothreadFunction · 0.85
freeFunction · 0.70

Tested by

no test coverage detected