]> sourceware.org Git - lvm2.git/commitdiff
scan: remove unused args from label_read
authorDavid Teigland <teigland@redhat.com>
Fri, 11 May 2018 19:16:49 +0000 (14:16 -0500)
committerDavid Teigland <teigland@redhat.com>
Fri, 11 May 2018 19:16:49 +0000 (14:16 -0500)
lib/cache/lvmcache.c
lib/label/label.c
lib/label/label.h
lib/metadata/metadata-liblvm.c
lib/metadata/metadata.c
tools/toollib.c

index 3f9e6fde75cbb3746e6c045bb85b6fa1174fef53..4062faa5e8c65cc33af41c9ca4b75e6b50483726 100644 (file)
@@ -810,7 +810,7 @@ const struct format_type *lvmcache_fmt_from_vgname(struct cmd_context *cmd,
 
        dm_list_iterate_safe(devh, tmp, &devs) {
                devl = dm_list_item(devh, struct device_list);
-               label_read(devl->dev, NULL, UINT64_C(0));
+               label_read(devl->dev);
                dm_list_del(&devl->list);
                dm_free(devl);
        }
@@ -1438,7 +1438,7 @@ int lvmcache_label_scan(struct cmd_context *cmd)
 
                dm_list_iterate_items(devl, &add_cache_devs) {
                        log_debug_cache("Rescan preferred device %s for lvmcache", dev_name(devl->dev));
-                       label_read(devl->dev, NULL, UINT64_C(0));
+                       label_read(devl->dev);
                }
 
                dm_list_splice(&_unused_duplicate_devs, &del_cache_devs);
@@ -1629,7 +1629,7 @@ const char *lvmcache_pvid_from_devname(struct cmd_context *cmd,
                return NULL;
        }
 
-       if (!(label_read(dev, NULL, UINT64_C(0))))
+       if (!label_read(dev))
                return NULL;
 
        return dev->pvid;
index ab040e123d01982079f43d501b1382cbadda4fdd..cd54b69b9937242805a806946d23e19a1bc1345b 100644 (file)
@@ -847,9 +847,7 @@ void label_scan_destroy(struct cmd_context *cmd)
  * device, this is not a commonly used function.
  */
 
-/* FIXME: remove unused_sector arg */
-
-int label_read(struct device *dev, struct label **labelp, uint64_t unused_sector)
+int label_read(struct device *dev)
 {
        struct dm_list one_dev;
        struct device_list *devl;
@@ -869,18 +867,6 @@ int label_read(struct device *dev, struct label **labelp, uint64_t unused_sector
 
        _scan_list(NULL, NULL, &one_dev, &failed);
 
-       /*
-        * FIXME: this ugliness of returning a pointer to the label is
-        * temporary until the callers can be updated to not use this.
-        */
-       if (labelp) {
-               struct lvmcache_info *info;
-
-               info = lvmcache_info_from_pvid(dev->pvid, dev, 1);
-               if (info)
-                       *labelp = lvmcache_get_label(info);
-       }
-
        if (failed)
                return 0;
        return 1;
index 508cb6fd3d624894b03577e0817d7ace8549bb63..0ef1d8369ccbfb6941d06744f65c10f55c999ca8 100644 (file)
@@ -109,7 +109,7 @@ void label_scan_invalidate(struct device *dev);
 void label_scan_invalidate_lv(struct cmd_context *cmd, struct logical_volume *lv);
 void label_scan_drop(struct cmd_context *cmd);
 void label_scan_destroy(struct cmd_context *cmd);
-int label_read(struct device *dev, struct label **labelp, uint64_t unused_sector);
+int label_read(struct device *dev);
 int label_read_sector(struct device *dev, uint64_t scan_sector);
 void label_scan_confirm(struct device *dev);
 int label_scan_setup_bcache(void);
index f7a07a504533f5872fc86bfc56bcce0cd2b4e82f..df4fdd969b8a548682da68ec863ba5fa2b6b0190 100644 (file)
@@ -483,7 +483,6 @@ static int _pvremove_check(struct cmd_context *cmd, const char *name,
 {
        static const char really_wipe_msg[] = "Really WIPE LABELS from physical volume";
        struct device *dev;
-       struct label *label;
        struct pv_list *pvl;
        struct physical_volume *pv = NULL;
        int used;
@@ -498,7 +497,7 @@ static int _pvremove_check(struct cmd_context *cmd, const char *name,
 
        /* Is there a pv here already? */
        /* If not, this is an error unless you used -f. */
-       if (!label_read(dev, &label, 0)) {
+       if (!label_read(dev)) {
                if (force_count)
                        return 1;
                log_error("No PV label found on %s.", name);
index bfdc4cf1814932f0fdb89bfa3be758f0668143b0..1636026639d17710b1024cf112c5fb127af0d309 100644 (file)
@@ -4058,7 +4058,7 @@ static struct volume_group *_vg_read(struct cmd_context *cmd,
                                                release_vg(correct_vg);
                                                correct_vg = NULL;
                                                lvmcache_del(info);
-                                               label_read(pvl->pv->dev, NULL, 0);
+                                               label_read(pvl->pv->dev);
                                                goto restart_scan;
                                        }
 #endif
index 5e5cc5157b327ea04bbe60274a378e4e42885137..afd80608a6e0934a699afe55b9e82a9b90de8f8c 100644 (file)
@@ -1558,7 +1558,7 @@ int process_each_label(struct cmd_context *cmd, int argc, char **argv,
                        /*
                         * add info to lvmcache from the duplicate dev.
                         */
-                       label_read(devl->dev, NULL, 0);
+                       label_read(devl->dev);
 
                        /*
                         * the info/label should now be found because
This page took 0.112256 seconds and 5 git commands to generate.