* bdirty: * * Turn buffer into delayed write request. We must clear BIO_READ and * B_RELBUF, and we must set B_DELWRI. We reassign the buffer to * itself to properly update it in the dirty/clean lists. We mark it * B_DONE to ensure that any asynchronization of the buffer properly * clears B_DONE ( else a panic will occur later ). * * bdirty() is kinda like bdwrite() - we have to clea
| 2465 | * The buffer must be on QUEUE_NONE. |
| 2466 | */ |
| 2467 | void |
| 2468 | bdirty(struct buf *bp) |
| 2469 | { |
| 2470 | |
| 2471 | CTR3(KTR_BUF, "bdirty(%p) vp %p flags %X", |
| 2472 | bp, bp->b_vp, bp->b_flags); |
| 2473 | KASSERT(bp->b_bufobj != NULL, ("No b_bufobj %p", bp)); |
| 2474 | KASSERT(bp->b_flags & B_REMFREE || bp->b_qindex == QUEUE_NONE, |
| 2475 | ("bdirty: buffer %p still on queue %d", bp, bp->b_qindex)); |
| 2476 | bp->b_flags &= ~(B_RELBUF); |
| 2477 | bp->b_iocmd = BIO_WRITE; |
| 2478 | |
| 2479 | if ((bp->b_flags & B_DELWRI) == 0) { |
| 2480 | bp->b_flags |= /* XXX B_DONE | */ B_DELWRI; |
| 2481 | reassignbuf(bp); |
| 2482 | bdirtyadd(bp); |
| 2483 | } |
| 2484 | } |
| 2485 | |
| 2486 | /* |
| 2487 | * bundirty: |
no test coverage detected