summaryrefslogtreecommitdiffstats
path: root/fs/ceph/crush/mapper.h
diff options
context:
space:
mode:
authorSage Weil2009-10-06 20:31:11 +0200
committerSage Weil2009-10-06 20:31:11 +0200
commit5ecc0a0f8128b1876e8614638deaed49cc8b174c (patch)
tree6b1511b0e3ec2a349a24faebc375548b14ee137a /fs/ceph/crush/mapper.h
parentceph: OSD client (diff)
downloadkernel-qcow2-linux-5ecc0a0f8128b1876e8614638deaed49cc8b174c.tar.gz
kernel-qcow2-linux-5ecc0a0f8128b1876e8614638deaed49cc8b174c.tar.xz
kernel-qcow2-linux-5ecc0a0f8128b1876e8614638deaed49cc8b174c.zip
ceph: CRUSH mapping algorithm
CRUSH is a pseudorandom data distribution function designed to map inputs onto a dynamic hierarchy of devices, while minimizing the extent to which inputs are remapped when the devices are added or removed. It includes some features that are specifically useful for storage, most notably the ability to map each input onto a set of N devices that are separated across administrator-defined failure domains. CRUSH is used to distribute data across the cluster of Ceph storage nodes. More information about CRUSH can be found in this paper: http://www.ssrc.ucsc.edu/Papers/weil-sc06.pdf Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/crush/mapper.h')
-rw-r--r--fs/ceph/crush/mapper.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/fs/ceph/crush/mapper.h b/fs/ceph/crush/mapper.h
new file mode 100644
index 000000000000..98e90046fd9f
--- /dev/null
+++ b/fs/ceph/crush/mapper.h
@@ -0,0 +1,20 @@
+#ifndef _CRUSH_MAPPER_H
+#define _CRUSH_MAPPER_H
+
+/*
+ * CRUSH functions for find rules and then mapping an input to an
+ * output set.
+ *
+ * LGPL2
+ */
+
+#include "crush.h"
+
+extern int crush_find_rule(struct crush_map *map, int pool, int type, int size);
+extern int crush_do_rule(struct crush_map *map,
+ int ruleno,
+ int x, int *result, int result_max,
+ int forcefeed, /* -1 for none */
+ __u32 *weights);
+
+#endif