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

Function bq_remove

freebsd/kern/vfs_bio.c:1878–1899  ·  view source on GitHub ↗

* bq_remove: * * Removes a buffer from the free list, must be called with the * correct qlock held. */

Source from the content-addressed store, hash-verified

1876 * correct qlock held.
1877 */
1878static void
1879bq_remove(struct bufqueue *bq, struct buf *bp)
1880{
1881
1882 CTR3(KTR_BUF, "bq_remove(%p) vp %p flags %X",
1883 bp, bp->b_vp, bp->b_flags);
1884 KASSERT(bp->b_qindex != QUEUE_NONE,
1885 ("bq_remove: buffer %p not on a queue.", bp));
1886 KASSERT(bufqueue(bp) == bq,
1887 ("bq_remove: Remove buffer %p from wrong queue.", bp));
1888
1889 BQ_ASSERT_LOCKED(bq);
1890 if (bp->b_qindex != QUEUE_EMPTY) {
1891 BUF_ASSERT_XLOCKED(bp);
1892 }
1893 KASSERT(bq->bq_len >= 1,
1894 ("queue %d underflow", bp->b_qindex));
1895 TAILQ_REMOVE(&bq->bq_queue, bp, b_freelist);
1896 bq->bq_len--;
1897 bp->b_qindex = QUEUE_NONE;
1898 bp->b_flags &= ~(B_REMFREE | B_REUSE);
1899}
1900
1901static void
1902bd_flush(struct bufdomain *bd, struct bufqueue *bq)

Callers 4

binsfreeFunction · 0.85
buf_importFunction · 0.85
buf_recycleFunction · 0.85
bremfreefFunction · 0.85

Calls 1

bufqueueFunction · 0.70

Tested by

no test coverage detected