* bufmallocadjust: * * Adjust the reported bufspace for a malloc managed buffer, possibly * waking any waiters. */
| 862 | * waking any waiters. |
| 863 | */ |
| 864 | static void |
| 865 | bufmallocadjust(struct buf *bp, int bufsize) |
| 866 | { |
| 867 | int diff; |
| 868 | |
| 869 | KASSERT((bp->b_flags & B_MALLOC) != 0, |
| 870 | ("bufmallocadjust: non-malloc buf %p", bp)); |
| 871 | diff = bufsize - bp->b_bufsize; |
| 872 | if (diff < 0) |
| 873 | atomic_subtract_long(&bufmallocspace, -diff); |
| 874 | else |
| 875 | atomic_add_long(&bufmallocspace, diff); |
| 876 | bp->b_bufsize = bufsize; |
| 877 | } |
| 878 | |
| 879 | /* |
| 880 | * runningwakeup: |
no test coverage detected