Permalink
Browse files

actually use volume names in LE to PE translation

  • Loading branch information...
1 parent 9654351 commit 905a2851e183692a26795d2b7dece69f884c4f65 @tomato42 committed Aug 2, 2012
Showing with 7 additions and 5 deletions.
  1. +3 −3 lvmls.c
  2. +1 −1 lvmls.h
  3. +3 −1 volumes.c
View
@@ -212,10 +212,10 @@ void parse_pvs_segments(int level, const char *file, int line,
// convert logical extent from logical volume specified by lv_name,
// vg_name and logical extent number (le_num) to physical extent
// on specific device
-struct pv_info *LE_to_PE(char *vg_name, char *lv_name, uint64_t le_num)
+struct pv_info *LE_to_PE(const char *vg_name, const char *lv_name, uint64_t le_num)
{
- struct pv_allocations pv_alloc = { .lv_name = lv_name,
- .vg_name = vg_name,
+ struct pv_allocations pv_alloc = { .lv_name = (char *)lv_name,
+ .vg_name = (char *)vg_name,
.lv_start = le_num };
struct pv_allocations *needle;
View
@@ -34,7 +34,7 @@ void pv_info_free(struct pv_info *pv);
// convert logical extent from logical volume specified by lv_name,
// vg_name and logical extent number (le_num) to physical extent
// on specific device
-struct pv_info *LE_to_PE(char *vg_name, char *lv_name, uint64_t le_num);
+struct pv_info *LE_to_PE(const char *vg_name, const char *lv_name, uint64_t le_num);
uint64_t get_pe_size(const char *vg_name);
View
@@ -136,7 +136,9 @@ get_volume_stats(struct program_params *pp, const char *lv_name, struct extent_s
// get logical extent to physical extent mapping for extent
struct pv_info *pv_i;
- pv_i = LE_to_PE("stacja", "dane", i); // XXX get from params/config
+ pv_i = LE_to_PE(get_volume_vg(pp, lv_name),
+ get_volume_lv(pp, lv_name),
+ i);
if (!pv_i) {
fprintf(stderr, "error when translating extent %li\n", i);
fprintf(stderr, "Do you have permission to access lvm device?\n");

0 comments on commit 905a285

Please sign in to comment.