Skip to contentSkip to conversation

Implement lvm_lv_activate and lvm_lv_deactivate liblvm calls.

PATCH New Dave Wysochanski 1 participant 1 message Jul 26, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Implement lvm_lv_activate and lvm_lv_deactivate liblvm calls.

Limited implementation but other types of activation should probably have separate calls. We also currently do not handle pvmoves or lvconverts.

---
 liblvm/.exported_symbols |    2 ++
 liblvm/lvm.h             |   25 +++++++++++++++++++++++++
 liblvm/lvm_lv.c          |   44 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 71 insertions(+), 0 deletions(-)
liblvm/.exported_symbols +2 -0
index d0e87df..6708154 100644
@@ -12,6 +12,8 @@ lvm_vg_get_extent_size
 lvm_vg_get_extent_count
 lvm_vg_get_free_extent_count
 lvm_vg_get_pv_count
+lvm_lv_activate
+lvm_lv_deactivate
 lvm_lv_get_uuid
 lvm_lv_get_name
 lvm_lv_get_size
liblvm/lvm.h +25 -0
index ac64ca2..c5c4486 100644
@@ -441,6 +441,31 @@ struct dm_list *lvm_vg_list_lvs(vg_t *vg);
 lv_t *lvm_vg_create_lv_linear(vg_t *vg, const char *name, uint64_t size);
 
 /**
+ * Activate a logical volume.
+ *
+ * This API is the equivalent of the lvm command "lvchange -ay".
+ *
+ * NOTE: This API cannot currently handle LVs with an in-progress pvmove or
+ * lvconvert.
+ *
+ * \param   lv
+ *          Logical volume handle.
+ * \return  Status code of 1 (success) or 0 (failure).
+ */
+int lvm_lv_activate(lv_t *lv);
+
+/**
+ * Deactivate a logical volume.
+ *
+ * This API is the equivalent of the lvm command "lvchange -an".
+ *
+ * \param   lv
+ *          Logical volume handle.
+ * \return  Status code of 1 (success) or 0 (failure).
+ */
+int lvm_lv_deactivate(lv_t *lv);
+
+/**
  * Remove a logical volume from a volume group.
  *
  * This function commits the change to disk and does _not_ require calling
liblvm/lvm_lv.c +44 -0

53 lines not on this page · raw message

Signature · 1 line
1.6.0.6