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)
Tue, May 14, 9:17 AM
Unknown Object (File)
Sat, May 11, 12:44 AM
Unknown Object (File)
Fri, May 10, 9:08 AM
Unknown Object (File)
Thu, Apr 25, 6:42 AM
Unknown Object (File)
Fri, Apr 19, 4:04 PM
Unknown Object (File)
Apr 19 2024, 11:48 AM
Unknown Object (File)
Apr 19 2024, 8:34 AM
Unknown Object (File)
Apr 1 2024, 4:17 AM

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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