diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2021-03-05 23:04:44 +0100 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2021-03-08 15:30:18 +0100 |
commit | 936c7b5104e4fb6fb489845b87d9ba2cd1a69d0a (patch) | |
tree | 15f730e471874f58f3b1cdce3c60e30c61ae4ca8 /lib/format_text | |
parent | bc0cb663043bb9c67151f88061ff22c53c6883ea (diff) | |
download | lvm2-936c7b5104e4fb6fb489845b87d9ba2cd1a69d0a.tar.gz |
vg_read: reuse already parsed config tree
When parsing VG metadata we can create from a single config tree
also 'vg_committed' that is always created for writable VG.
This avoids extra uncessary step of serializing and deserilizing
just parsed VG.
Diffstat (limited to 'lib/format_text')
-rw-r--r-- | lib/format_text/import.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/format_text/import.c b/lib/format_text/import.c index 2dc80f13f..2687d172e 100644 --- a/lib/format_text/import.c +++ b/lib/format_text/import.c @@ -186,6 +186,8 @@ struct volume_group *text_read_metadata(struct format_instance *fid, goto_out; (*vsn)->read_desc(vg->vgmem, cft, when, desc); + vg->committed_cft = cft; /* Reuse CFT for recreation of committed VG */ + cft = NULL; break; } @@ -198,7 +200,8 @@ struct volume_group *text_read_metadata(struct format_instance *fid, *use_previous_vg = 0; out: - config_destroy(cft); + if (cft) + config_destroy(cft); return vg; } |