diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index 904348af3..2ed265cb5 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -967,30 +967,6 @@ static struct seg_pvs *_find_seg_pvs_by_le(struct dm_list *list, uint32_t le) return NULL; } -/* - * Find first unused LV number. - */ -uint32_t find_free_lvnum(struct logical_volume *lv) -{ - int lvnum_used[MAX_RESTRICTED_LVS + 1] = { 0 }; - uint32_t i = 0; - struct lv_list *lvl; - int lvnum; - - dm_list_iterate_items(lvl, &lv->vg->lvs) { - lvnum = lvnum_from_lvid(&lvl->lv->lvid); - if (lvnum <= MAX_RESTRICTED_LVS) - lvnum_used[lvnum] = 1; - } - - while (lvnum_used[i]) - i++; - - /* FIXME What if none are free? */ - - return i; -} - dm_percent_t copy_percent(const struct logical_volume *lv) { uint32_t numerator = 0u, denominator = 0u; diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h index 9c372a7f0..af9c3864b 100644 --- a/lib/metadata/metadata-exported.h +++ b/lib/metadata/metadata-exported.h @@ -34,7 +34,6 @@ #define STRIPE_SIZE_MIN ( (unsigned) lvm_getpagesize() >> SECTOR_SHIFT) /* PAGESIZE in sectors */ #define STRIPE_SIZE_MAX ( 512L * 1024L >> SECTOR_SHIFT) /* 512 KB in sectors */ #define STRIPE_SIZE_LIMIT ((UINT_MAX >> 2) + 1) -#define MAX_RESTRICTED_LVS 255 /* Used by FMT_RESTRICTED_LVIDS */ #define MAX_EXTENT_SIZE ((uint32_t) -1) #define MIN_NON_POWER2_EXTENT_SIZE (128U * 2U) /* 128KB in sectors */ @@ -1431,7 +1430,6 @@ const char *get_pvmove_pvname_from_lv_mirr(const struct logical_volume *lv_mirr) struct dm_list *lvs_using_lv(struct cmd_context *cmd, struct volume_group *vg, struct logical_volume *lv); -uint32_t find_free_lvnum(struct logical_volume *lv); dm_percent_t copy_percent(const struct logical_volume *lv); char *generate_lv_name(struct volume_group *vg, const char *format, char *buffer, size_t len); diff --git a/lib/metadata/metadata.h b/lib/metadata/metadata.h index 95fd359c7..3d470207f 100644 --- a/lib/metadata/metadata.h +++ b/lib/metadata/metadata.h @@ -32,7 +32,6 @@ //#define STRIPE_SIZE_MIN ( (unsigned) lvm_getpagesize() >> SECTOR_SHIFT) /* PAGESIZE in sectors */ //#define STRIPE_SIZE_MAX ( 512L * 1024L >> SECTOR_SHIFT) /* 512 KB in sectors */ //#define STRIPE_SIZE_LIMIT ((UINT_MAX >> 2) + 1) -//#define MAX_RESTRICTED_LVS 255 /* Used by FMT_RESTRICTED_LVIDS */ #define MIN_PE_SIZE (8192L >> SECTOR_SHIFT) /* 8 KB in sectors - format1 only */ #define MAX_PE_SIZE (16L * 1024L * (1024L >> SECTOR_SHIFT) * 1024L) /* format1 only */ #define MIRROR_LOG_OFFSET 2 /* sectors */ diff --git a/lib/uuid/uuid.c b/lib/uuid/uuid.c index d8b72422b..78f7781df 100644 --- a/lib/uuid/uuid.c +++ b/lib/uuid/uuid.c @@ -44,38 +44,6 @@ void uuid_from_num(char *uuid, uint32_t num) } } -int lvid_from_lvnum(union lvid *lvid, struct id *vgid, uint32_t lv_num) -{ - int i; - - memcpy(lvid->id, vgid, sizeof(*lvid->id)); - - for (i = ID_LEN; i; i--) { - lvid->id[1].uuid[i - 1] = _c[lv_num % (sizeof(_c) - 1)]; - lv_num /= sizeof(_c) - 1; - } - - lvid->s[sizeof(lvid->s) - 1] = '\0'; - - return 1; -} - -int lvnum_from_lvid(union lvid *lvid) -{ - int i, lv_num = 0; - char *c; - - for (i = 0; i < ID_LEN; i++) { - lv_num *= sizeof(_c) - 1; - if ((c = strchr(_c, lvid->id[1].uuid[i]))) - lv_num += (int) (c - _c); - if (lv_num < 0) - lv_num = 0; - } - - return lv_num; -} - int lvid_in_restricted_range(union lvid *lvid) { int i; diff --git a/lib/uuid/uuid.h b/lib/uuid/uuid.h index 17d7d9821..f22533dda 100644 --- a/lib/uuid/uuid.h +++ b/lib/uuid/uuid.h @@ -35,8 +35,6 @@ union lvid { char s[2 * sizeof(struct id) + 1 + 7]; }; -int lvid_from_lvnum(union lvid *lvid, struct id *vgid, uint32_t lv_num); -int lvnum_from_lvid(union lvid *lvid); int lvid_in_restricted_range(union lvid *lvid); void uuid_from_num(char *uuid, uint32_t num);