Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
mapper.c File Reference
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <linux/crush/crush.h>
#include <linux/crush/hash.h>
#include <linux/crush/mapper.h>

Go to the source code of this file.


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


int crush_find_rule (const struct crush_map *map, int ruleset, int type, int size)
int crush_do_rule (const struct crush_map *map, int ruleno, int x, int *result, int result_max, const __u32 *weight)

Macro Definition Documentation

#define BUG_ON (   x)    assert(!(x))

Definition at line 15 of file mapper.c.

#define dprintk (   args...)    /* printf(args) */

Definition at line 16 of file mapper.c.

#define kfree (   x)    free(x)

Definition at line 18 of file mapper.c.

#define kmalloc (   x,
)    malloc(x)

Definition at line 17 of file mapper.c.

Function Documentation

int crush_do_rule ( const struct crush_map map,
int  ruleno,
int  x,
int result,
int  result_max,
const __u32 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

Definition at line 469 of file mapper.c.

int crush_find_rule ( const 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

Definition at line 36 of file mapper.c.