Page MenuHomeFreeBSD

protosw: hide PR_FASTHZ / PR_SLOWHZ.
AbandonedPublic

Authored by melifaro on Jul 8 2022, 10:33 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jan 12, 6:34 PM
Unknown Object (File)
Dec 8 2024, 3:22 AM
Unknown Object (File)
Sep 17 2024, 8:36 PM
Unknown Object (File)
Sep 16 2024, 5:21 AM
Unknown Object (File)
Sep 5 2024, 5:43 AM
Unknown Object (File)
Aug 15 2024, 1:07 AM
Unknown Object (File)
Jul 7 2024, 11:36 PM
Unknown Object (File)
Jun 28 2024, 11:27 PM
Subscribers

Details

Reviewers
None
Group Reviewers
network
Summary

Use newly-added time conversion functions instead of direct PR_FASTHZ / PR_SLOWHZ access

Exact amount of ticks for PR_FASTHZ / PR_SLOWHZ is an implementation detail of the domain/protosw subsystem. Exposing these values directly leads to complications / broken assumptions in the code.
When exposed, these time units propagate farther to the code and it's hard to understand whether it's seconds, ticks, slow ticks, fast ticks and so on.
Some of the user-visible constants are even defined in these slow/fast ticks, making it harder to reason about.

Some of the assumptions (like (PR_FASTHZ / 2) /* 500ms */) are tied to the specific value of the constant and will fail if/when it's changed.

Address this by adding milli_to_<slow|fast>timo() functions, allowing to express the desired delay in milliseconds.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 46320
Build 43209: arc lint + arc unit