mercoledì 7 novembre 2012

GEOM naming

As far as I can understand reading the documentation and looking at the FreeBSD GEOM source tree, the naming scheme is as follows:
  • each transformation specification is written upper-case;
  • each transformation class is written lower-case;
  • each module that defines and implements a class lacks the initial g;
  • usually each device that is perceived as a provider uses the module name as a way of indicating the service, such has using an extension or being under a folder with the module name if the /dev directory;
  • each file in the above module has the g_ prefix, followed by the class name (lower-case) and an optional suffix with a leading underscore.
So for instance, in the case of the disk encryption we have that:
  • GELI (upper-case) specifies the transformation, that is the contract for the service;
  • geli (lower-case) is the class implementation, that is the code that implements the above contract;
  • eli is the module that contains the source code, that is the folder in the source tree;
  • eli is the extension of an encrypted device (e.g., /dev/da0s1e.eli);
  • each file in the above source tree is named g_eli with an optional suffix.
As another example consider the mirroring facilities:
  • GMIRROR is the transformation;
  • gmirror is the class implementation;
  • mirror is the module that contains the source code for the class implementation;
  • usually mirrors are under /dev/mirror;
  • each file is named g_mirror and something more.

Nessun commento: