Motr  M0
hash.c File Reference
#include "lib/bob.h"
#include "lib/hash.h"
#include "lib/errno.h"
#include "lib/arith.h"
#include "lib/memory.h"
#include "lib/misc.h"
#include "lib/trace.h"
Include dependency graph for hash.c:

Go to the source code of this file.

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_LIB
 

Functions

 M0_BOB_DEFINE (static, &htable_bobtype, m0_htable)
 
static bool htable_invariant (const struct m0_htable *htable)
 
static void hbucket_init (const struct m0_ht_descr *d, struct m0_hbucket *bucket)
 
static void hbucket_fini (const struct m0_ht_descr *d, struct m0_hbucket *bucket)
 
static void * obj_key (const struct m0_ht_descr *hd, void *obj)
 
static bool hbucket_invariant (const struct m0_ht_descr *desc, const struct m0_hbucket *bucket, const struct m0_htable *htable)
 
M0_INTERNAL int m0_htable_init (const struct m0_ht_descr *d, struct m0_htable *htable, uint64_t bucket_nr)
 
M0_INTERNAL bool m0_htable_is_init (const struct m0_htable *htable)
 
M0_INTERNAL void m0_htable_add (struct m0_htable *htable, void *amb)
 
M0_INTERNAL void m0_htable_del (struct m0_htable *htable, void *amb)
 
M0_INTERNAL void * m0_htable_lookup (const struct m0_htable *htable, const void *key)
 
M0_INTERNAL void m0_htable_cc_add (struct m0_htable *htable, void *amb)
 
M0_INTERNAL void m0_htable_cc_del (struct m0_htable *htable, void *amb)
 
M0_INTERNAL void * m0_htable_cc_lookup (struct m0_htable *htable, const void *key)
 
M0_INTERNAL void m0_hbucket_lock (struct m0_htable *htable, const void *key)
 
M0_INTERNAL void m0_hbucket_unlock (struct m0_htable *htable, const void *key)
 
M0_INTERNAL void m0_htable_fini (struct m0_htable *htable)
 
M0_INTERNAL bool m0_htable_is_empty (const struct m0_htable *htable)
 
M0_INTERNAL uint64_t m0_htable_size (const struct m0_htable *htable)
 
M0_INTERNAL uint64_t m0_hash (uint64_t x)
 

Variables

static const struct m0_bob_type htable_bobtype