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

Function buf_import

freebsd/kern/vfs_bio.c:1598–1615  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

1596 * only as a per-cpu cache of bufs still maintained on a global list.
1597 */
1598static int
1599buf_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:

Callers

nothing calls this directly

Calls 1

bq_removeFunction · 0.85

Tested by

no test coverage detected