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);
}
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);
return NULL;
}
- if (!(label_read(dev, NULL, UINT64_C(0))))
+ if (!label_read(dev))
return NULL;
return dev->pvid;
* 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;
_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;
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);
{
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;
/* 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);
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
/*
* 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