| 3436 | } |
| 3437 | |
| 3438 | static void |
| 3439 | vdbatch_enqueue(struct vnode *vp) |
| 3440 | { |
| 3441 | struct vdbatch *vd; |
| 3442 | |
| 3443 | ASSERT_VI_LOCKED(vp, __func__); |
| 3444 | VNASSERT(!VN_IS_DOOMED(vp), vp, |
| 3445 | ("%s: deferring requeue of a doomed vnode", __func__)); |
| 3446 | |
| 3447 | if (vp->v_dbatchcpu != NOCPU) { |
| 3448 | VI_UNLOCK(vp); |
| 3449 | return; |
| 3450 | } |
| 3451 | |
| 3452 | sched_pin(); |
| 3453 | vd = DPCPU_PTR(vd); |
| 3454 | mtx_lock(&vd->lock); |
| 3455 | MPASS(vd->index < VDBATCH_SIZE); |
| 3456 | MPASS(vd->tab[vd->index] == NULL); |
| 3457 | /* |
| 3458 | * A hack: we depend on being pinned so that we know what to put in |
| 3459 | * ->v_dbatchcpu. |
| 3460 | */ |
| 3461 | vp->v_dbatchcpu = curcpu; |
| 3462 | vd->tab[vd->index] = vp; |
| 3463 | vd->index++; |
| 3464 | VI_UNLOCK(vp); |
| 3465 | if (vd->index == VDBATCH_SIZE) |
| 3466 | vdbatch_process(vd); |
| 3467 | mtx_unlock(&vd->lock); |
| 3468 | sched_unpin(); |
| 3469 | } |
| 3470 | |
| 3471 | /* |
| 3472 | * This routine must only be called for vnodes which are about to be |
no test coverage detected