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

Function bd_flush

freebsd/kern/vfs_bio.c:1901–1924  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1899}
1900
1901static void
1902bd_flush(struct bufdomain *bd, struct bufqueue *bq)
1903{
1904 struct buf *bp;
1905
1906 BQ_ASSERT_LOCKED(bq);
1907 if (bq != bd->bd_cleanq) {
1908 BD_LOCK(bd);
1909 while ((bp = TAILQ_FIRST(&bq->bq_queue)) != NULL) {
1910 TAILQ_REMOVE(&bq->bq_queue, bp, b_freelist);
1911 TAILQ_INSERT_TAIL(&bd->bd_cleanq->bq_queue, bp,
1912 b_freelist);
1913 bp->b_subqueue = bd->bd_cleanq->bq_subqueue;
1914 }
1915 bd->bd_cleanq->bq_len += bq->bq_len;
1916 bq->bq_len = 0;
1917 }
1918 if (bd->bd_wanted) {
1919 bd->bd_wanted = 0;
1920 wakeup(&bd->bd_wanted);
1921 }
1922 if (bq != bd->bd_cleanq)
1923 BD_UNLOCK(bd);
1924}
1925
1926static int
1927bd_flushall(struct bufdomain *bd)

Callers 2

bd_flushallFunction · 0.85
bq_insertFunction · 0.85

Calls 1

wakeupFunction · 0.70

Tested by

no test coverage detected