* buf_import: * * Import bufs into the uma cache from the buf list. The system still * expects a static array of bufs and much of the synchronization * around bufs assumes type stable storage. As a result, UMA is used * only as a per-cpu cache of bufs still maintained on a global list. */
| 1596 | * only as a per-cpu cache of bufs still maintained on a global list. |
| 1597 | */ |
| 1598 | static int |
| 1599 | buf_import(void *arg, void **store, int cnt, int domain, int flags) |
| 1600 | { |
| 1601 | struct buf *bp; |
| 1602 | int i; |
| 1603 | |
| 1604 | BQ_LOCK(&bqempty); |
| 1605 | for (i = 0; i < cnt; i++) { |
| 1606 | bp = TAILQ_FIRST(&bqempty.bq_queue); |
| 1607 | if (bp == NULL) |
| 1608 | break; |
| 1609 | bq_remove(&bqempty, bp); |
| 1610 | store[i] = bp; |
| 1611 | } |
| 1612 | BQ_UNLOCK(&bqempty); |
| 1613 | |
| 1614 | return (i); |
| 1615 | } |
| 1616 | |
| 1617 | /* |
| 1618 | * buf_release: |
nothing calls this directly
no test coverage detected