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

lv_manip: init major minor in alloc_lv

Move initialization of major and minor to alloc_lv().
This commit is contained in:
Zdenek Kabelac 2024-10-28 11:05:59 +01:00
parent e2b00dd162
commit 16241b2dc7
2 changed files with 3 additions and 4 deletions

View File

@ -973,8 +973,6 @@ static int _read_lvsegs(struct cmd_context *cmd,
return_0;
lv->size = (uint64_t) lv->le_count * (uint64_t) vg->extent_size;
lv->minor = -1;
lv->major = -1;
if (lv->status & FIXED_MINOR) {
if (!_read_int32(lvn, "minor", &lv->minor)) {

View File

@ -7303,6 +7303,9 @@ struct logical_volume *alloc_lv(struct dm_pool *mem)
return NULL;
}
lv->major = -1;
lv->minor = -1;
dm_list_init(&lv->snapshot_segs);
dm_list_init(&lv->segments);
dm_list_init(&lv->tags);
@ -7356,8 +7359,6 @@ struct logical_volume *lv_create_empty(const char *name,
lv->status = status;
lv->alloc = alloc;
lv->read_ahead = vg->cmd->default_settings.read_ahead;
lv->major = -1;
lv->minor = -1;
lv->size = UINT64_C(0);
lv->le_count = 0;