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

Function racct_add_buf

freebsd/kern/kern_racct.c:646–664  ·  view source on GitHub ↗

* Account for disk IO resource consumption. Checks for limits, * but never fails, due to disk limits being undeniable. */

Source from the content-addressed store, hash-verified

644 * but never fails, due to disk limits being undeniable.
645 */
646void
647racct_add_buf(struct proc *p, const struct buf *bp, int is_write)
648{
649
650 ASSERT_RACCT_ENABLED();
651 PROC_LOCK_ASSERT(p, MA_OWNED);
652
653 SDT_PROBE3(racct, , rusage, add__buf, p, bp, is_write);
654
655 RACCT_LOCK();
656 if (is_write) {
657 racct_add_locked(curproc, RACCT_WRITEBPS, bp->b_bcount, 1);
658 racct_add_locked(curproc, RACCT_WRITEIOPS, 1, 1);
659 } else {
660 racct_add_locked(curproc, RACCT_READBPS, bp->b_bcount, 1);
661 racct_add_locked(curproc, RACCT_READIOPS, 1, 1);
662 }
663 RACCT_UNLOCK();
664}
665
666static int
667racct_set_locked(struct proc *p, int resource, uint64_t amount, int force)

Callers 4

breadaFunction · 0.85
breadn_flagsFunction · 0.85
bufwriteFunction · 0.85
cluster_readFunction · 0.85

Calls 1

racct_add_lockedFunction · 0.85

Tested by

no test coverage detected