]> sourceware.org Git - lvm2.git/commitdiff
cleanup: simplify initilization
authorZdenek Kabelac <zkabelac@redhat.com>
Sat, 20 Feb 2021 21:44:06 +0000 (22:44 +0100)
committerZdenek Kabelac <zkabelac@redhat.com>
Tue, 23 Feb 2021 13:56:48 +0000 (14:56 +0100)
Simplier code and also drop duplicate check for active LV.

tools/lvconvert.c

index 4dee97ee0e934a38fe11287caf64c831d425525c..a67b4ee7298aac73a3453c302a08584e8fcde6e9 100644 (file)
@@ -6126,7 +6126,7 @@ int lvconvert_writecache_attach_single(struct cmd_context *cmd,
        struct volume_group *vg = lv->vg;
        struct logical_volume *lv_wcorig;
        struct logical_volume *lv_fast;
-       struct writecache_settings settings;
+       struct writecache_settings settings = { 0 };
        const char *fast_name;
        uint32_t block_size_sectors = 0;
        char *lockd_fast_args = NULL;
@@ -6181,10 +6181,6 @@ int lvconvert_writecache_attach_single(struct cmd_context *cmd,
 
        is_active = lv_is_active(lv);
 
-       is_active = lv_is_active(lv);
-
-       memset(&settings, 0, sizeof(settings));
-
        if (!get_writecache_settings(cmd, &settings, &block_size_sectors)) {
                log_error("Invalid writecache settings.");
                goto bad;
This page took 0.041139 seconds and 5 git commands to generate.