Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
crush.h File Reference
#include <linux/types.h>

Go to the source code of this file.

Data Structures

struct  crush_rule_step
 
struct  crush_rule_mask
 
struct  crush_rule
 
struct  crush_bucket
 
struct  crush_bucket_uniform
 
struct  crush_bucket_list
 
struct  crush_bucket_tree
 
struct  crush_bucket_straw
 
struct  crush_map
 

Macros

#define CRUSH_MAGIC   0x00010000ul /* for detecting algorithm revisions */
 
#define CRUSH_MAX_DEPTH   10 /* max crush hierarchy depth */
 
#define CRUSH_MAX_SET   10 /* max size of a mapping result */
 
#define CRUSH_CHOOSE_N   0
 
#define CRUSH_CHOOSE_N_MINUS(x)   (-(x))
 
#define crush_rule_size(len)
 

Enumerations

enum  {
  CRUSH_RULE_NOOP = 0, CRUSH_RULE_TAKE = 1, CRUSH_RULE_CHOOSE_FIRSTN = 2, CRUSH_RULE_CHOOSE_INDEP = 3,
  CRUSH_RULE_EMIT = 4, CRUSH_RULE_CHOOSE_LEAF_FIRSTN = 6, CRUSH_RULE_CHOOSE_LEAF_INDEP = 7
}
 
enum  { CRUSH_BUCKET_UNIFORM = 1, CRUSH_BUCKET_LIST = 2, CRUSH_BUCKET_TREE = 3, CRUSH_BUCKET_STRAW = 4 }
 

Functions

const charcrush_bucket_alg_name (int alg)
 
int crush_get_bucket_item_weight (const struct crush_bucket *b, int pos)
 
void crush_destroy_bucket_uniform (struct crush_bucket_uniform *b)
 
void crush_destroy_bucket_list (struct crush_bucket_list *b)
 
void crush_destroy_bucket_tree (struct crush_bucket_tree *b)
 
void crush_destroy_bucket_straw (struct crush_bucket_straw *b)
 
void crush_destroy_bucket (struct crush_bucket *b)
 
void crush_destroy (struct crush_map *map)
 

Macro Definition Documentation

#define CRUSH_CHOOSE_N   0

Definition at line 54 of file crush.h.

#define CRUSH_CHOOSE_N_MINUS (   x)    (-(x))

Definition at line 55 of file crush.h.

#define CRUSH_MAGIC   0x00010000ul /* for detecting algorithm revisions */

Definition at line 20 of file crush.h.

#define CRUSH_MAX_DEPTH   10 /* max crush hierarchy depth */

Definition at line 23 of file crush.h.

#define CRUSH_MAX_SET   10 /* max size of a mapping result */

Definition at line 24 of file crush.h.

#define crush_rule_size (   len)
Value:
(sizeof(struct crush_rule) + \
(len)*sizeof(struct crush_rule_step))

Definition at line 75 of file crush.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
CRUSH_RULE_NOOP 
CRUSH_RULE_TAKE 
CRUSH_RULE_CHOOSE_FIRSTN 
CRUSH_RULE_CHOOSE_INDEP 
CRUSH_RULE_EMIT 
CRUSH_RULE_CHOOSE_LEAF_FIRSTN 
CRUSH_RULE_CHOOSE_LEAF_INDEP 

Definition at line 39 of file crush.h.

anonymous enum
Enumerator:
CRUSH_BUCKET_UNIFORM 
CRUSH_BUCKET_LIST 
CRUSH_BUCKET_TREE 
CRUSH_BUCKET_STRAW 

Definition at line 94 of file crush.h.

Function Documentation

const char* crush_bucket_alg_name ( int  alg)

Definition at line 13 of file crush.c.

void crush_destroy ( struct crush_map map)

crush_destroy - Destroy a crush_map : crush_map pointer

Definition at line 102 of file crush.c.

void crush_destroy_bucket ( struct crush_bucket b)

Definition at line 80 of file crush.c.

void crush_destroy_bucket_list ( struct crush_bucket_list b)

Definition at line 54 of file crush.c.

void crush_destroy_bucket_straw ( struct crush_bucket_straw b)

Definition at line 71 of file crush.c.

void crush_destroy_bucket_tree ( struct crush_bucket_tree b)

Definition at line 63 of file crush.c.

void crush_destroy_bucket_uniform ( struct crush_bucket_uniform b)

Definition at line 47 of file crush.c.

int crush_get_bucket_item_weight ( const struct crush_bucket b,
int  p 
)

crush_get_bucket_item_weight - Get weight of an item in given bucket : bucket pointer : item index in bucket

Definition at line 29 of file crush.c.