master - metadata: Add a pv_label accessor (go from a PV to its label).
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=dc3a0711454938e1a6264b7e3bf24a6dd1ac7e9f Commit: dc3a0711454938e1a6264b7e3bf24a6dd1ac7e9f Parent: a2034e9a99337ac16ee415f7f2398e0b8e976716 Author: Petr Rockai <[email protected]> AuthorDate: Mon Jul 29 18:54:59 2013 +0200 Committer: Petr Rockai <[email protected]> CommitterDate: Sun Nov 17 21:41:27 2013 +0100
metadata: Add a pv_label accessor (go from a PV to its label).
--- lib/metadata/pv.c | 10 ++++++++++ lib/metadata/pv.h | 1 + 2 files changed, 11 insertions(+), 0 deletions(-)
lib/metadata/pv.c +10 -0
@@ -350,3 +350,13 @@ unsigned pv_mda_set_ignored(const struct physical_volume *pv, unsigned mda_ignorreturn 1 ; } +struct label *pv_label (const struct physical_volume *pv) +{ +struct lvmcache_info *info = +lvmcache_info_from_pvid ((const char *)&pv->id.uuid,0 ); +if (!info) { +log_error (INTERNAL_ERROR "PV %s unexpectedly not in cache." ,dev_name (pv->dev)); +return NULL ; + } +return lvmcache_get_label (info); +}
lib/metadata/pv.h +1 -0
@@ -95,5 +95,6 @@ unsigned pv_mda_set_ignored(const struct physical_volume *pv, unsigned ignored);int is_orphan (const struct physical_volume *pv);int is_missing_pv (const struct physical_volume *pv);int is_pv (const struct physical_volume *pv); +struct label *pv_label (const struct physical_volume *pv);#endif /* _LVM_PV_H */