Page MenuHomeFreeBSD

netgraph/ng_bridge: Make simple internal functions read-only
ClosedPublic

Authored by donner on Jan 13 2021, 8:22 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Oct 24, 2:57 AM
Unknown Object (File)
Fri, Oct 18, 12:07 PM
Unknown Object (File)
Oct 7 2024, 12:39 PM
Unknown Object (File)
Oct 5 2024, 12:50 AM
Unknown Object (File)
Oct 3 2024, 10:27 PM
Unknown Object (File)
Oct 1 2024, 10:11 PM
Unknown Object (File)
Oct 1 2024, 7:49 PM
Unknown Object (File)
Sep 29 2024, 5:48 PM

Diff Detail

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

Event Timeline

revert the idea of specialized "const pointers"

It's far that simple. I missed the difference between

  • const node_p: a constant pointer to a modifiable node.
  • struct ng_node const * : a modifiable pointer to a constant node.

Because I need immutable data structures, the latter is required.
But those structures and helper functions are defined in the central netgraph.h and ng_base.c.
Hence I have to annotate the base system with const, and also every helper function, which does not modify the data.

I think it's worth the effort, because it will ease the way write multithreaded netgraph modules and fix several still hidden race conditions.

  • Fix some formatting, line up comments.
  • Annotate helper functions to handle immutable objects.
kp added a subscriber: kp.

LGTM

This revision is now accepted and ready to land.Feb 7 2021, 8:40 AM