HomeFreeBSD

Avoid the nbp lookup in the final loop iteration in flushbuflist().

Description

Avoid the nbp lookup in the final loop iteration in flushbuflist().

The end of the loop must re-lookup the next buf since the bufobj lock
is dropped in the loop body. If the lookup fails, the loop is restarted.
This mechanism non-obviously also terminates the loop when the end of
the buf list is reached. Split up the two loops termination cases to
make the code a bit less fragile. No functional change intended.

Reviewed by: kib
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12730

Details

Provenance
markjAuthored on
Reviewer
kib
Differential Revision
D12730: Avoid the nbp lookup in the final loop iteration in flushbuflist()
Parents
rS324803: mtx: fix up UP build after r324778
Branches
Unknown
Tags
Unknown