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

Function binsfree

freebsd/kern/vfs_bio.c:1525–1558  ·  view source on GitHub ↗

* binsfree: * * Insert the buffer into the appropriate free list. Requires a * locked buffer on entry and buffer is unlocked before return. */

Source from the content-addressed store, hash-verified

1523 * locked buffer on entry and buffer is unlocked before return.
1524 */
1525static void
1526binsfree(struct buf *bp, int qindex)
1527{
1528 struct bufdomain *bd;
1529 struct bufqueue *bq;
1530
1531 KASSERT(qindex == QUEUE_CLEAN || qindex == QUEUE_DIRTY,
1532 ("binsfree: Invalid qindex %d", qindex));
1533 BUF_ASSERT_XLOCKED(bp);
1534
1535 /*
1536 * Handle delayed bremfree() processing.
1537 */
1538 if (bp->b_flags & B_REMFREE) {
1539 if (bp->b_qindex == qindex) {
1540 bp->b_flags |= B_REUSE;
1541 bp->b_flags &= ~B_REMFREE;
1542 BUF_UNLOCK(bp);
1543 return;
1544 }
1545 bq = bufqueue_acquire(bp);
1546 bq_remove(bq, bp);
1547 BQ_UNLOCK(bq);
1548 }
1549 bd = bufdomain(bp);
1550 if (qindex == QUEUE_CLEAN) {
1551 if (bd->bd_lim != 0)
1552 bq = &bd->bd_subq[PCPU_GET(cpuid)];
1553 else
1554 bq = bd->bd_cleanq;
1555 } else
1556 bq = &bd->bd_dirtyq;
1557 bq_insert(bq, bp, true);
1558}
1559
1560/*
1561 * buf_free:

Callers 2

brelseFunction · 0.85
bqrelseFunction · 0.85

Calls 4

bufqueue_acquireFunction · 0.85
bq_removeFunction · 0.85
bq_insertFunction · 0.85
bufdomainFunction · 0.70

Tested by

no test coverage detected