Skip to contentSkip to conversation

LVM2 ./WHATS_NEW_DM libdm/.exported_symbols li ...

PATCH [email protected] 1 participant 1 message Jun 9, 2009

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: mbroz at sourceware.org 2009-06-09 16:10:25

Modified files:
. : WHATS_NEW_DM
libdm : .exported_symbols libdevmapper.h
libdm-deptree.c

Log message:
Support crypt segment in libdevmapper tree.

- it can support multiple segments, but note that to work properly, correct IV (initialization vector) offset parameter must be set properly.

Because most usage of IV start offset is when we join several crypto segments together (so iv_offset is the segment start offset), DM_CRYPT_IV_DEFAULT is defined to simplify the process.

Function accepts the string in cipher agrument (already including chainmode and iv type; chainmode and iv parameters are NULL in this case) or user can provide split parameters which will join into dm-crypt cipher specification "cipher-chainmode-iv".

All these parameters must be supplied in correct dm-crypt format.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW_DM.diff?cvsroot=lvm2&r1=1.275&r2=1.276
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/.exported_symbols.diff?cvsroot=lvm2&r1=1.35&r2=1.36
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdevmapper.h.diff?cvsroot=lvm2&r1=1.88&r2=1.89
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-deptree.c.diff?cvsroot=lvm2&r1=1.50&r2=1.51

WHATS_NEW_DM +2 -1
@@ -1,5 +1,6 @@
-Version 1.02.33 -    
+Version 1.02.33 -
 ===============================
+  Add crypt target handling to libdevmapper node.
   Add splitname command to dmsetup.
   Add subsystem, vg_name, lv_name, lv_layer fields to dmsetup reports.
   Make mempool optional in dm_split_lvm_name().
libdm/.exported_symbols +1 -0
@@ -67,6 +67,7 @@
 dm_tree_node_add_zero_target
 dm_tree_node_add_linear_target
 dm_tree_node_add_striped_target
+dm_tree_node_add_crypt_target
 dm_tree_node_add_mirror_target
 dm_tree_node_add_mirror_target_log
 dm_tree_node_add_target_area
libdm/libdevmapper.h +15 -0
@@ -374,6 +374,21 @@
 int dm_tree_node_add_striped_target(struct dm_tree_node *node,
 				       uint64_t size,
 				       uint32_t stripe_size);
+
+#define DM_CRYPT_IV_DEFAULT	UINT64_C(-1)	/* iv_offset == seg offset */
+/*
+ * Function accepts one string in cipher specification
+ * (chainmode and iv should be NULL because included in cipher string)
+ *   or
+ * separate arguments which will be joined to "cipher-chainmode-iv"
+ */
+int dm_tree_node_add_crypt_target(struct dm_tree_node *node,
+				  uint64_t size,
+				  const char *cipher,
+				  const char *chainmode,
+				  const char *iv,
+				  uint64_t iv_offset,
+				  const char *key);
 int dm_tree_node_add_mirror_target(struct dm_tree_node *node,
 				      uint64_t size);
  
libdm/libdm-deptree.c +41 -3

86 lines not on this page · raw message