| 3340 | SYSINIT(bufdaemon, SI_SUB_KTHREAD_BUF, SI_ORDER_FIRST, kproc_start, &buf_kp); |
| 3341 | |
| 3342 | static int |
| 3343 | buf_flush(struct vnode *vp, struct bufdomain *bd, int target) |
| 3344 | { |
| 3345 | int flushed; |
| 3346 | |
| 3347 | flushed = flushbufqueues(vp, bd, target, 0); |
| 3348 | if (flushed == 0) { |
| 3349 | /* |
| 3350 | * Could not find any buffers without rollback |
| 3351 | * dependencies, so just write the first one |
| 3352 | * in the hopes of eventually making progress. |
| 3353 | */ |
| 3354 | if (vp != NULL && target > 2) |
| 3355 | target /= 2; |
| 3356 | flushbufqueues(vp, bd, target, 1); |
| 3357 | } |
| 3358 | return (flushed); |
| 3359 | } |
| 3360 | |
| 3361 | static void |
| 3362 | buf_daemon() |
no test coverage detected