* bdirtyadd: * * Increment the numdirtybuffers count by one and wakeup the buf * daemon if needed. */
| 590 | * daemon if needed. |
| 591 | */ |
| 592 | static void |
| 593 | bdirtyadd(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: |
no test coverage detected