summaryrefslogtreecommitdiff
path: root/liblvm/lvm2app.h
diff options
context:
space:
mode:
authorPetr Rockai <prockai@redhat.com>2010-11-25 14:33:44 +0000
committerPetr Rockai <prockai@redhat.com>2010-11-25 14:33:44 +0000
commit14b0c96bc72cfd08daf00cb1395fd04446c22d71 (patch)
treeec3643ded8ca7f3df23e783fc604a291593c2f66 /liblvm/lvm2app.h
parent46f84d5cb97def607294917cf5fb50899c3e1cea (diff)
downloadlvm2-14b0c96bc72cfd08daf00cb1395fd04446c22d71.tar.gz
This patch adds helpers to allow users to lookup a lv or pv handle by
name (given a vg_t of course). Signed-off-by: Dave Wysochanski <wysochanski@pobox.com> Reviewed-by: Petr Rockai <prockai@redhat.com>
Diffstat (limited to 'liblvm/lvm2app.h')
-rw-r--r--liblvm/lvm2app.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/liblvm/lvm2app.h b/liblvm/lvm2app.h
index d6378ac4f..4750211be 100644
--- a/liblvm/lvm2app.h
+++ b/liblvm/lvm2app.h
@@ -1015,6 +1015,23 @@ lv_t lvm_vg_create_lv_linear(vg_t vg, const char *name, uint64_t size);
struct dm_list *lvm_lv_list_lvsegs(lv_t lv);
/**
+ * Lookup an LV handle in a VG by the LV name.
+ *
+ * \memberof lv_t
+ *
+ * \param vg
+ * VG handle obtained from lvm_vg_create() or lvm_vg_open().
+ *
+ * \param name
+ * Name of LV to lookup.
+ *
+ * \return
+ * non-NULL handle to the LV 'name' attached to the VG.
+ * NULL is returned if the LV name is not associated with the VG handle.
+ */
+lv_t lvm_lv_from_name(vg_t vg, const char *name);
+
+/**
* Activate a logical volume.
*
* \memberof lv_t
@@ -1489,6 +1506,23 @@ struct lvm_property_value lvm_pvseg_get_property(const pvseg_t pvseg,
struct dm_list *lvm_pv_list_pvsegs(pv_t pv);
/**
+ * Lookup an PV handle in a VG by the PV name.
+ *
+ * \memberof pv_t
+ *
+ * \param vg
+ * VG handle obtained from lvm_vg_create() or lvm_vg_open().
+ *
+ * \param name
+ * Name of PV to lookup.
+ *
+ * \return
+ * non-NULL handle to the PV 'name' attached to the VG.
+ * NULL is returned if the PV name is not associated with the VG handle.
+ */
+pv_t lvm_pv_from_name(vg_t vg, const char *name);
+
+/**
* Resize physical volume to new_size bytes.
*
* \memberof pv_t