1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

cleanup: drop unused code

Code was related to long time obsoleted  vgconvert
for lvm1 to lvm2 conversion.
This code likely was missed to be removed.
This commit is contained in:
Zdenek Kabelac 2024-03-27 15:02:25 +01:00
parent 4ba683bb18
commit fc477192e5
5 changed files with 0 additions and 61 deletions

View File

@ -967,30 +967,6 @@ static struct seg_pvs *_find_seg_pvs_by_le(struct dm_list *list, uint32_t le)
return NULL; 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) dm_percent_t copy_percent(const struct logical_volume *lv)
{ {
uint32_t numerator = 0u, denominator = 0u; uint32_t numerator = 0u, denominator = 0u;

View File

@ -34,7 +34,6 @@
#define STRIPE_SIZE_MIN ( (unsigned) lvm_getpagesize() >> SECTOR_SHIFT) /* PAGESIZE in sectors */ #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_MAX ( 512L * 1024L >> SECTOR_SHIFT) /* 512 KB in sectors */
#define STRIPE_SIZE_LIMIT ((UINT_MAX >> 2) + 1) #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 MAX_EXTENT_SIZE ((uint32_t) -1)
#define MIN_NON_POWER2_EXTENT_SIZE (128U * 2U) /* 128KB in sectors */ #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 dm_list *lvs_using_lv(struct cmd_context *cmd, struct volume_group *vg,
struct logical_volume *lv); struct logical_volume *lv);
uint32_t find_free_lvnum(struct logical_volume *lv);
dm_percent_t copy_percent(const 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 *generate_lv_name(struct volume_group *vg, const char *format,
char *buffer, size_t len); char *buffer, size_t len);

View File

@ -32,7 +32,6 @@
//#define STRIPE_SIZE_MIN ( (unsigned) lvm_getpagesize() >> SECTOR_SHIFT) /* PAGESIZE in sectors */ //#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_MAX ( 512L * 1024L >> SECTOR_SHIFT) /* 512 KB in sectors */
//#define STRIPE_SIZE_LIMIT ((UINT_MAX >> 2) + 1) //#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 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 MAX_PE_SIZE (16L * 1024L * (1024L >> SECTOR_SHIFT) * 1024L) /* format1 only */
#define MIRROR_LOG_OFFSET 2 /* sectors */ #define MIRROR_LOG_OFFSET 2 /* sectors */

View File

@ -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 lvid_in_restricted_range(union lvid *lvid)
{ {
int i; int i;

View File

@ -35,8 +35,6 @@ union lvid {
char s[2 * sizeof(struct id) + 1 + 7]; 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); int lvid_in_restricted_range(union lvid *lvid);
void uuid_from_num(char *uuid, uint32_t num); void uuid_from_num(char *uuid, uint32_t num);