* Account for disk IO resource consumption. Checks for limits, * but never fails, due to disk limits being undeniable. */
| 644 | * but never fails, due to disk limits being undeniable. |
| 645 | */ |
| 646 | void |
| 647 | racct_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 | |
| 666 | static int |
| 667 | racct_set_locked(struct proc *p, int resource, uint64_t amount, int force) |
no test coverage detected