Subject: Re: dynamic sysctl
To: Jason Thorpe <email@example.com>
From: Andrew Brown <firstname.lastname@example.org>
Date: 11/14/2003 14:40:52
>> and then you have all the mappings for name<->number under net. for
>> the children of those nodes, you simply iterate.
>What happens if the name<->number mappings change in between the
>mapping call and the walking? It's dynamic, so you're going to have to
the answer is that each node has a version number (an int -- i am
studiously ignoring the case where the version number wraps around).
when a node is created the global version counter is incremented and
the new version number is assigned to the new node and its parent,
straight up to the root of the tree.
likewise, when a node is destroyed, the global version number is
incremented, and the new version number is assigned to the parent of
the node that is being destroyed all the way back up the tree.
sysctlnametomib() just checks that all the versions are the same at
the top of the tree each time it's called, and for those that have
changed, it purges that data from its cache.
|-----< "CODE WARRIOR" >-----|
email@example.com * "ah! i see you have the internet
firstname.lastname@example.org (Andrew Brown) that goes *ping*!"
email@example.com * "information is power -- share the wealth."