From Kerrighed

Name space is the first level of naming for KDDM objects.

A KDDM name space hosts a class of KDDM sets. The semantic behind "class" is up to the Kerrighed developper. A name space can host for instance:

  • All system KDDM sets
  • System KDDM sets related to a given Linux name space
  • All KDDM sets linked to file address spaces for a given storage device.
  • etc...

Contents

Default Name Space

A default name space is created during Kerrighed initialization. This name space hosts all the system KDDM which are not linked to a Linux name space. Up to now, we do not support Linux name spaces, so all the current system KDDM are stored in the default name space.

The default name space is defined as follow:

  • KDDM_DEF_NS_ID: id of the default name space
  • kddm_def_ns: structure of the default name space.

Manipulation Functions

create_kddm_ns

struct kddm_ns *create_kddm_ns ( int ns_id,                // id of the new name space to create.
                                 void *private,            // private data to link with the new name space.
                                 struct kddm_ns_ops *ops   // name space operations linked to the new name space.
                               );

The create_kddm_ns function creates a new kddm name space.

remove_kddm_ns

int remove_kddm_ns ( int ns_id     // Id of the name space to remove.
                   );

The remove_kddm_ns function removes a kddm name space.

kddm_ns_get

struct kddm_ns *kddm_ns_get ( int ns_id  // Id of the name space to get.
                            );

The kddm_ns_get function returns a name space structure from a name space ID.

  • The ns structure count is incremented by the function.
  • A call to kddm_ns_put is mandatory after the use of the ns structure is over.

kddm_ns_put

void kddm_ns_put ( struct kddm_ns *ns  // Structure of the name space to put.
                 );

The kddm_ns_put function releases a name space structure.

  • The ns structure count is decremented by the function.
  • This function is used after a call to kddm_ns_get.