Page MenuHomeFreeBSD

subr_hints: simplify a little bit
ClosedPublic

Authored by kevans on Jun 20 2018, 11:43 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 4 2024, 11:09 PM
Unknown Object (File)
Mar 4 2024, 11:09 PM
Unknown Object (File)
Mar 4 2024, 11:08 PM
Unknown Object (File)
Mar 4 2024, 10:52 PM
Unknown Object (File)
Dec 10 2023, 11:24 AM
Unknown Object (File)
Sep 22 2023, 11:33 AM
Unknown Object (File)
Sep 7 2023, 12:22 AM
Unknown Object (File)
Sep 7 2023, 12:20 AM
Subscribers

Details

Summary

(This simplification is driven by some other early environment changes I would like to make)

Some complexity exists in these bits that isn't needed. The sysctl handler, upon change to '2', runs through the current set of hints and sets them in the kenv.

However, this isn't at all necessary if we're pulling hints from the kenv, static or dynamic, as the former will get added to the latter in init_dynamic_kenv [https://svnweb.freebsd.org/base/head/sys/kern/kern_environment.c?view=markup#l271]. We can reduce this configuration to just adding static_hints to the kenv if we were previously using them.

The changes in res_find are minimal, and based on the observation that once use_kenv gets set to '1' it will never be reset to 0, and it gets set to 1 as soon as we hit fallback mode. Later work will refactor res_find a little bit and eliminate this now-local, because it's become clear that there's some funkiness revolving around use_kenv=1 and it being used to imply that we're certainly looking at the dynamic_kenv.

Diff Detail

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

Event Timeline

Looks good.
Thank you!

This revision is now accepted and ready to land.Jun 21 2018, 6:48 AM
This revision was automatically updated to reflect the committed changes.