Skip to contentSkip to conversation

master - device_mapper: basic support for vdo dm target

PATCH Zdenek Kabelac 1 participant 1 message Jul 9, 2018

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=d8a41f22e9a68b0424ee18b1859fb6369c712622
Commit:        d8a41f22e9a68b0424ee18b1859fb6369c712622
Parent:        0d9a4c69896137f1b440ec6da187387f6394d1fb
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Fri Jun 29 11:08:51 2018 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Mon Jul 9 15:28:35 2018 +0200

device_mapper: basic support for vdo dm target

---
 device_mapper/Makefile         |    4 +-
 device_mapper/all.h            |    9 ++
 device_mapper/libdm-deptree.c  |  162 ++++++++++++++++++++++++++++++++++++++++
 device_mapper/vdo/target.h     |   40 ++++++++++
 device_mapper/vdo/vdo_target.c |  121 ++++++++++++++++++++++++++++++
 5 files changed, 335 insertions(+), 1 deletions(-)
device_mapper/Makefile +3 -1
index 30717b6..d74a751 100644
@@ -24,7 +24,9 @@ DEVICE_MAPPER_SOURCE=\
 	device_mapper/regex/matcher.c \
 	device_mapper/regex/parse_rx.c \
 	device_mapper/regex/ttree.c \
-	device_mapper/ioctl/libdm-iface.c
+	device_mapper/ioctl/libdm-iface.c \
+	device_mapper/vdo/vdo_target.c \
+	device_mapper/vdo/status.c
 
 DEVICE_MAPPER_DEPENDS=$(addprefix $(top_builddir)/,$(subst .c,.d,$(DEVICE_MAPPER_SOURCE)))
 DEVICE_MAPPER_OBJECTS=$(addprefix $(top_builddir)/,$(subst .c,.o,$(DEVICE_MAPPER_SOURCE)))
device_mapper/all.h +9 -0
index 602b7ba..e56bae9 100644
@@ -19,6 +19,7 @@
 
 #include "base/data-struct/list.h"
 #include "base/data-struct/hash.h"
+#include "vdo/target.h"
 
 #include <inttypes.h>
 #include <stdarg.h>
@@ -914,6 +915,14 @@ int dm_tree_node_add_cache_target(struct dm_tree_node *node,
 				  uint32_t data_block_size);
 
 /*
+ * VDO target
+ */
+int dm_tree_node_add_vdo_target(struct dm_tree_node *node,
+				uint64_t size,
+				const char *data_uuid,
+				const struct dm_vdo_target_params *param);
+
+/*
  * FIXME Add individual cache policy pairs  <key> = value, like:
  * int dm_tree_node_add_cache_policy_arg(struct dm_tree_node *dnode,
  *				      const char *key, uint64_t value);
device_mapper/libdm-deptree.c +162 -0

225 lines not on this page · raw message

device_mapper/vdo/target.h +40 -0
index 3d8722b..c597491 100644
@@ -66,6 +66,46 @@ struct dm_pool;
 bool dm_vdo_status_parse(struct dm_pool *mem, const char *input,
 			 struct dm_vdo_status_parse_result *result);
 
+enum dm_vdo_write_policy {
+	DM_VDO_WRITE_POLICY_AUTO = 0,
+	DM_VDO_WRITE_POLICY_SYNC,
+	DM_VDO_WRITE_POLICY_ASYNC
+};
+
+// FIXME: review whether we should use the createParams from the userlib
+struct dm_vdo_target_params {
+	uint32_t block_map_cache_size_mb;
+	uint32_t block_map_period;
+
+	uint32_t check_point_frequency;
+	uint32_t index_memory_size_mb;
+
+	uint32_t read_cache_size_mb;
+
+	uint32_t slab_size_mb;
+
+	// threads
+	uint32_t ack_threads;
+	uint32_t bio_threads;
+	uint32_t bio_rotation;
+	uint32_t cpu_threads;
+	uint32_t hash_zone_threads;
+	uint32_t logical_threads;
+	uint32_t physical_threads;
+
+	bool use_compression;
+	bool use_deduplication;
+	bool emulate_512_sectors;
+	bool use_sparse_index;
+	bool use_read_cache;
+
+	// write policy
+	enum dm_vdo_write_policy write_policy;
+};
+
+bool dm_vdo_validate_target_params(const struct dm_vdo_target_params *vtp,
+				   uint64_t vdo_size);
+
 //----------------------------------------------------------------
 
 #endif
device_mapper/vdo/vdo_target.c new file +121 -0

121 lines not on this page · raw message