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

Function unp_remove_dead_ref

freebsd/kern/uipc_usrreq.c:2558–2580  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2556static int unp_marked;
2557
2558static void
2559unp_remove_dead_ref(struct filedescent **fdep, int fdcount)
2560{
2561 struct unpcb *unp;
2562 struct file *fp;
2563 int i;
2564
2565 /*
2566 * This function can only be called from the gc task.
2567 */
2568 KASSERT(taskqueue_member(taskqueue_thread, curthread) != 0,
2569 ("%s: not on gc callout", __func__));
2570 UNP_LINK_LOCK_ASSERT();
2571
2572 for (i = 0; i < fdcount; i++) {
2573 fp = fdep[i]->fde_file;
2574 if ((unp = fptounp(fp)) == NULL)
2575 continue;
2576 if ((unp->unp_gcflag & UNPGC_DEAD) == 0)
2577 continue;
2578 unp->unp_gcrefs--;
2579 }
2580}
2581
2582static void
2583unp_restore_undead_ref(struct filedescent **fdep, int fdcount)

Callers

nothing calls this directly

Calls 2

taskqueue_memberFunction · 0.85
fptounpFunction · 0.85

Tested by

no test coverage detected