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

Function bufqueue_acquire

freebsd/kern/vfs_bio.c:1496–1517  ·  view source on GitHub ↗

* Return the locked bufqueue that bp is a member of. */

Source from the content-addressed store, hash-verified

1494 * Return the locked bufqueue that bp is a member of.
1495 */
1496static struct bufqueue *
1497bufqueue_acquire(struct buf *bp)
1498{
1499 struct bufqueue *bq, *nbq;
1500
1501 /*
1502 * bp can be pushed from a per-cpu queue to the
1503 * cleanq while we're waiting on the lock. Retry
1504 * if the queues don't match.
1505 */
1506 bq = bufqueue(bp);
1507 BQ_LOCK(bq);
1508 for (;;) {
1509 nbq = bufqueue(bp);
1510 if (bq == nbq)
1511 break;
1512 BQ_UNLOCK(bq);
1513 BQ_LOCK(nbq);
1514 bq = nbq;
1515 }
1516 return (bq);
1517}
1518
1519/*
1520 * binsfree:

Callers 2

binsfreeFunction · 0.85
bremfreefFunction · 0.85

Calls 1

bufqueueFunction · 0.70

Tested by

no test coverage detected