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
F108438179: D28141.id83473.diff
Fri, Jan 24, 6:54 PM
Unknown Object (File)
Wed, Jan 22, 5:23 PM
Unknown Object (File)
Fri, Jan 17, 10:19 PM
Unknown Object (File)
Fri, Jan 17, 4:28 PM
Unknown Object (File)
Fri, Jan 17, 3:58 PM
Unknown Object (File)
Dec 14 2024, 10:46 AM
Unknown Object (File)
Nov 29 2024, 3:59 PM
Unknown Object (File)
Nov 29 2024, 3:59 PM

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