Defines | Functions

mapper.cpp File Reference

#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <iostream>
#include "crush.h"
#include "hash.h"
Include dependency graph for mapper.cpp:


#define BUG_ON(x)   assert(!(x))
#define dprintk(args...)
#define kmalloc(x, f)   malloc(x)
#define kfree(x)   free(x)


int crush_find_rule (struct crush_map *map, int ruleset, int type, int size)
int crush_do_rule (VDRIVE::Distributor *dist, struct crush_map *map, int ruleno, int64_t x, int *result, int result_max, int force, uint32_t *weight)

Define Documentation

#define BUG_ON (   x )    assert(!(x))
#define dprintk (   args... )
#define kfree (   x )    free(x)
#define kmalloc (   x,
)    malloc(x)

Function Documentation

int crush_do_rule ( VDRIVE::Distributor dist,
struct crush_map map,
int  ruleno,
int64_t  x,
int *  result,
int  result_max,
int  force,
uint32_t *  weight 

crush_do_rule - calculate a mapping with the given input and rule : the crush_map : the rule id : hash input

: pointer to result vector : maximum result size : force initial replica choice; -1 for none
int crush_find_rule ( struct crush_map map,
int  ruleset,
int  type,
int  size 

crush_find_rule - find a crush_rule id for a given ruleset, type, and size. : the crush_map : the storage ruleset id (user defined) : storage ruleset type (user defined) : output set size