Skip to content
This repository has been archived by the owner on Apr 25, 2018. It is now read-only.

Commit

Permalink
actually use volume names in LE to PE translation
Browse files Browse the repository at this point in the history
  • Loading branch information
tomato42 committed Aug 2, 2012
1 parent 9654351 commit 905a285
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lvmls.c
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lvmls.h
Expand Up @@ -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);

Expand Down
4 changes: 3 additions & 1 deletion volumes.c
Expand Up @@ -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");
Expand Down

0 comments on commit 905a285

Please sign in to comment.