1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

scan: remove unused args from label_read

This commit is contained in:
David Teigland 2018-05-11 14:16:49 -05:00
parent b5d9914628
commit 5c9dcd99fd
6 changed files with 8 additions and 23 deletions

View 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;

View 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;

View 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);

View 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);

View 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

View 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