Magic symlinks redux

Brooks Davis brooks at freebsd.org
Fri Aug 22 15:50:50 UTC 2008


On Fri, Aug 22, 2008 at 05:46:31PM +0200, Luigi Rizzo wrote:
> On Fri, Aug 22, 2008 at 10:07:29AM -0500, Brooks Davis wrote:
> > On Fri, Aug 22, 2008 at 04:56:16PM +0200, Luigi Rizzo wrote:
> > > On Fri, Aug 22, 2008 at 02:05:26PM +0200, Christian Brueffer wrote:
> > > > On Fri, Aug 22, 2008 at 12:24:41PM +0200, Ivan Voras wrote:
> > > ...
> > > > > This patch is huge. As far as I can tell DragonflyBSD has a whole 
> > > > > framework dedicated to varsyms, spread across a fair part of the kernel 
> > > > > and with at least one special userland utility. It allows the operator 
> > > > > to define his own variables that can be used in the substitutions, and I 
> > > > > don't see that it predefines "special" variables like "uid" and 
> > > > > "hostname". It's not necessarily a bad solution but I consider it overkill.
> > > ...
> > > > Brooks has a varsym port in p4, see //depot/user/brooks/varsym/
> > > 
> > > this also seems to be based on Dragonfly's code, quite intrusive.
> > 
> > This code adds one global symbol, one function call in the vfs code,
> > and two pointers to struct proc.  For that we get a system which is
> > significantly more flexible than the NetBSD code.
> > 
> > While the simplicity of the NetBSD code is somewhat attractive, the
> > fact that variables can not be defined renders it useless for my
> > purposes which are providing partial file system virtulization for
> > computing job/sessions where I need to key off of externally derived job
> > IDs or job specific temporary paths.
> 
> understood -- it's just that the difference in code size is impressive.
> 
> Do you know how much of it is used to implement the "varsym"
> subsystem (user- or system-wide variables) and how much is the
> core name translation ?

Most of it is maintaining the lists of variables, handling the system
calls to read and write them, and doing the lookup with the correct
locking context.  The basic match routine is about the same size, though
if you get a hit it's somewhat more expensive since you have to walk up
to three lists (two in what's in p4 at the moment, but I'm currently
splitting the per-proc code into privileged and un-privileged sets to
the administrator can add values to processes that later owners can't
modify) to resolve the variable name.

-- Brooks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20080822/06b86e5b/attachment.pgp


More information about the freebsd-arch mailing list