Page MenuHomeFreeBSD

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

Authored by markj on Oct 19 2017, 4:35 PM.
Tags
None
Referenced Files
F118850735: D12730.diff
Mon, Jun 2, 2:23 PM
F118832883: D12730.id34182.diff
Mon, Jun 2, 9:52 AM
Unknown Object (File)
Thu, May 29, 12:32 AM
Unknown Object (File)
Sat, May 24, 11:48 AM
Unknown Object (File)
Fri, May 23, 6:54 AM
Unknown Object (File)
Apr 14 2025, 8:23 AM
Unknown Object (File)
Apr 14 2025, 1:37 AM
Unknown Object (File)
Feb 28 2025, 1:14 PM
Subscribers
None

Details

Summary

At the end of the final iteration, we have lblkno = xflags = 0 and thus
set nbp = gbincore(bo, 0). The xflags test will fail and cause the loop
to end, but this seems like a fragile and non-obvious mechanism. Modify
the test so that we break if nbp == NULL at the beginning of the loop.

No functional change intended; we just avoid an unnecessary lookup once
per call.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

  • Avoid the inline assignment
This revision is now accepted and ready to land.Oct 19 2017, 5:24 PM
This revision was automatically updated to reflect the committed changes.