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
F137054980: D12730.id34147.diff
Fri, Nov 21, 1:41 AM
F137052931: D12730.id.diff
Fri, Nov 21, 1:36 AM
F137052475: D12730.id34148.diff
Fri, Nov 21, 1:35 AM
F137052369: D12730.id34182.diff
Fri, Nov 21, 1:35 AM
F137049489: D12730.diff
Fri, Nov 21, 1:25 AM
Unknown Object (File)
Mon, Nov 17, 1:59 PM
Unknown Object (File)
Fri, Nov 14, 8:08 PM
Unknown Object (File)
Fri, Nov 14, 11:11 AM
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

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 12126
Build 12427: arc lint + arc unit

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.