Motr  M0
hash.c File Reference
#include "lib/bob.h"
#include "lib/hash.h"
#include "lib/errno.h"
#include "motr/magic.h"
#include "ut/ut.h"
Include dependency graph for hash.c:

Go to the source code of this file.

Data Structures

struct  bar
 
struct  foo
 

Enumerations

enum  { BUCKET_NR = 8, FOO_NR = 19, BAR_MAGIC = 0xa817115ad15ababaULL, FOO_MAGIC = 0x911ea3a7096a96e5ULL }
 

Functions

static uint64_t hash_func (const struct m0_htable *htable, const void *k)
 
static bool key_eq (const void *key1, const void *key2)
 
 M0_HT_DESCR_DEFINE (foohash, "Hash of fops", static, struct foo, f_hlink, f_magic, FOO_MAGIC, BAR_MAGIC, f_hkey, hash_func, key_eq)
 
 M0_HT_DEFINE (foohash, static, struct foo, uint64_t)
 
void test_hashtable (void)
 

Variables

static struct foo foos [FOO_NR]
 
static struct bar thebar
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
BUCKET_NR 
FOO_NR 
BAR_MAGIC 
FOO_MAGIC 

Definition at line 49 of file hash.c.

Function Documentation

◆ hash_func()

static uint64_t hash_func ( const struct m0_htable htable,
const void *  k 
)
static

Definition at line 59 of file hash.c.

◆ key_eq()

static bool key_eq ( const void *  key1,
const void *  key2 
)
static

Definition at line 66 of file hash.c.

◆ M0_HT_DEFINE()

M0_HT_DEFINE ( foohash  ,
static  ,
struct foo  ,
uint64_t   
)

◆ M0_HT_DESCR_DEFINE()

M0_HT_DESCR_DEFINE ( foohash  ,
"Hash of fops"  ,
static  ,
struct foo  ,
f_hlink  ,
f_magic  ,
FOO_MAGIC  ,
BAR_MAGIC  ,
f_hkey  ,
hash_func  ,
key_eq   
)

◆ test_hashtable()

void test_hashtable ( void  )

Definition at line 80 of file hash.c.

Here is the call graph for this function:

Variable Documentation

◆ foos

struct foo foos[FOO_NR]
static

Definition at line 56 of file hash.c.

◆ thebar

struct bar thebar
static

Definition at line 57 of file hash.c.