From Kerrighed

Contents

Manipulation Functions

get_kddm_obj_entry

struct kddm_obj *get_kddm_obj_entry ( int ns_id,                    // Name space to look up the object in.
                                      kddm_set_id_t set_id,         // Set to look up the object in.
				      objid_t objid,                // Id o the object to look up for.
				      struct kddm_set **kddm_set    // The return kddm set structure.
                                    );
struct kddm_obj *__get_kddm_obj_entry ( struct kddm_set *kddm_set     // Set to look up the object in.
			 	        objid_t objid,                // Id o the object to look up for.
                                      );

The get_kddm_obj_entry looks up for an object in a kddm set.

  • If an object is found, its usage counter is incremented and the object structure is returned.
  • If no object is found, NULL is returned.

get_alloc_kddm_obj_entry

struct kddm_obj *get_alloc_kddm_obj_entry ( int ns_id,              // Name space to look up the object in.
 					    kddm_set_id_t set_id,   // Set to look up the object in.
					    objid_t objid,          // Id o the object to look up for.
					    void *object,           // 
				            struct kddm_set **kddm_set  // The return kddm set structure.
                                          );
struct kddm_obj *get_alloc_kddm_obj_entry ( struct kddm_set *kddm_set  // Set to look up the object in.
                                            objid_t objid,            // Id o the object to look up for.
					    void *object,             // 
                                          );

The get_alloc_kddm_obj_entry looks up for an object in a kddm set.

  • If an object is found, its usage counter is incremented and the object structure is returned.
  • If no object is found, an object entry is allocated and the object structure is returned.

put_kddm_obj_entry

struct kddm_obj *put_kddm_obj_entry ( struct kddm_set *kddm_set     // Set hosting the object.
                                      struct kddm_obj *obj_entry,   // Structure of the object to put.
                                      objid_t objid,                // Id o the object to put.
                                    );

The put_kddm_object_entry release an object acquired with a get_kddm_object_entry or get_alloc_kddm_object_entry.

  • The structure usage counter is decremented


alloc_kddm_obj_entry

struct kddm_obj *alloc_kddm_obj_entry ( struct kddm_set * kddm_set,  // Structure of the set to allocate the object in.
					objid_t objid               // Id of the object to allocate.
                                      );

The alloc_kddm_obj_entry allocates an object entry, not the object itself.

  • This function should normally never been used by kddm users.

free_kddm_obj_entry

void free_kddm_obj_entry ( struct kddm_obj *obj_entry,
			   struct kddm_set *kddm_set,
			   objid_t objid
                         );

The free_kddm_obj_entry frees an object entry and request to free the object to the IO linker.

  • This function should normally never been used by kddm users.

destroy_kddm_obj_entry

int destroy_kddm_obj_entry ( struct kddm_set *kddm_set,  // The kddm set the object to destroy belongs to.
			     objid_t objid,             // Id of the object to destroy.
			     int cluster_wide_remove    // Tells if the object removal is a cluster wide remove.
                           );

The destroy_kddm_obj_entry function removes an object from a kddm set locally. If other copies of the object exist on other nodes, they are not affected by this function.