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:
parent
e2b00dd162
commit
16241b2dc7
@ -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)) {
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user