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

Function bdirtyadd

freebsd/kern/vfs_bio.c:592–608  ·  view source on GitHub ↗

* bdirtyadd: * * Increment the numdirtybuffers count by one and wakeup the buf * daemon if needed. */

Source from the content-addressed store, hash-verified

590 * daemon if needed.
591 */
592static void
593bdirtyadd(struct buf *bp)
594{
595 struct bufdomain *bd;
596 int num;
597
598 /*
599 * Only do the wakeup once as we cross the boundary. The
600 * buf daemon will keep running until the condition clears.
601 */
602 bd = bufdomain(bp);
603 num = atomic_fetchadd_int(&bd->bd_numdirtybuffers, 1);
604 if (num == (bd->bd_lodirtybuffers + bd->bd_hidirtybuffers) / 2)
605 bd_wakeup();
606 if (num == bd->bd_lodirtybuffers || num == bd->bd_hidirtybuffers)
607 bd_set(bd);
608}
609
610/*
611 * bufspace_daemon_wakeup:

Callers 1

bdirtyFunction · 0.85

Calls 4

bd_wakeupFunction · 0.85
bd_setFunction · 0.85
bufdomainFunction · 0.70
atomic_fetchadd_intFunction · 0.50

Tested by

no test coverage detected