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

add label_scan_devs_cached

label_scan_devs without invalidating data first
for cases where the caller wants to use any
bcache data they have already read.
This commit is contained in:
David Teigland 2020-10-21 12:20:17 -05:00
parent 677f829e54
commit a7f195b7e8
2 changed files with 16 additions and 0 deletions

View File

@ -1302,6 +1302,21 @@ int label_read_pvid(struct device *dev)
return 1;
}
/*
* label_scan_devs without invalidating data for the devs first,
* when the caller wants to make use of any bcache data that
* they may have already read.
*/
int label_scan_devs_cached(struct cmd_context *cmd, struct dev_filter *f, struct dm_list *devs)
{
if (!scan_bcache)
return 0;
_scan_list(cmd, f, devs, NULL);
return 1;
}
/*
* Scan and cache lvm data from the listed devices. If a device is already
* scanned and cached, this replaces the previously cached lvm data for the

View File

@ -104,6 +104,7 @@ extern struct bcache *scan_bcache;
int label_scan(struct cmd_context *cmd);
int label_scan_devs(struct cmd_context *cmd, struct dev_filter *f, struct dm_list *devs);
int label_scan_devs_cached(struct cmd_context *cmd, struct dev_filter *f, struct dm_list *devs);
int label_scan_devs_rw(struct cmd_context *cmd, struct dev_filter *f, struct dm_list *devs);
int label_scan_devs_excl(struct dm_list *devs);
int label_scan_dev(struct device *dev);