1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-07 21:18:59 +03:00

scan: remove comments about lvmetad

This commit is contained in:
David Teigland 2019-05-02 13:32:30 -05:00
parent 81735b46d9
commit 99de816a1b

View File

@ -1024,8 +1024,6 @@ int label_scan_devs(struct cmd_context *cmd, struct dev_filter *f, struct dm_lis
{ {
struct device_list *devl; struct device_list *devl;
/* FIXME: get rid of this, it's only needed for lvmetad in which
case we should be setting up bcache in one place. */
if (!scan_bcache) { if (!scan_bcache) {
if (!_setup_bcache(0)) if (!_setup_bcache(0))
return 0; return 0;
@ -1227,14 +1225,6 @@ out:
return ret; return ret;
} }
/*
* This is only needed when commands are using lvmetad, in which case they
* don't do an initial label_scan, but may later need to rescan certain devs
* from disk and call this function. FIXME: is there some better number to
* choose here? How should we predict the number of devices that might need
* scanning when using lvmetad?
*/
int label_scan_setup_bcache(void) int label_scan_setup_bcache(void)
{ {
if (!scan_bcache) { if (!scan_bcache) {
@ -1293,7 +1283,7 @@ bool dev_read_bytes(struct device *dev, uint64_t start, size_t len, void *data)
} }
if (dev->bcache_fd <= 0) { if (dev->bcache_fd <= 0) {
/* This is not often needed, perhaps only with lvmetad. */ /* This is not often needed. */
if (!label_scan_open(dev)) { if (!label_scan_open(dev)) {
log_error("Error opening device %s for reading at %llu length %u.", log_error("Error opening device %s for reading at %llu length %u.",
dev_name(dev), (unsigned long long)start, (uint32_t)len); dev_name(dev), (unsigned long long)start, (uint32_t)len);
@ -1333,7 +1323,7 @@ bool dev_write_bytes(struct device *dev, uint64_t start, size_t len, void *data)
} }
if (dev->bcache_fd <= 0) { if (dev->bcache_fd <= 0) {
/* This is not often needed, perhaps only with lvmetad. */ /* This is not often needed. */
dev->flags |= DEV_BCACHE_WRITE; dev->flags |= DEV_BCACHE_WRITE;
if (!label_scan_open(dev)) { if (!label_scan_open(dev)) {
log_error("Error opening device %s for writing at %llu length %u.", log_error("Error opening device %s for writing at %llu length %u.",
@ -1379,7 +1369,7 @@ bool dev_write_zeros(struct device *dev, uint64_t start, size_t len)
} }
if (dev->bcache_fd <= 0) { if (dev->bcache_fd <= 0) {
/* This is not often needed, perhaps only with lvmetad. */ /* This is not often needed. */
dev->flags |= DEV_BCACHE_WRITE; dev->flags |= DEV_BCACHE_WRITE;
if (!label_scan_open(dev)) { if (!label_scan_open(dev)) {
log_error("Error opening device %s for writing at %llu length %u.", log_error("Error opening device %s for writing at %llu length %u.",
@ -1428,7 +1418,7 @@ bool dev_set_bytes(struct device *dev, uint64_t start, size_t len, uint8_t val)
} }
if (dev->bcache_fd <= 0) { if (dev->bcache_fd <= 0) {
/* This is not often needed, perhaps only with lvmetad. */ /* This is not often needed. */
dev->flags |= DEV_BCACHE_WRITE; dev->flags |= DEV_BCACHE_WRITE;
if (!label_scan_open(dev)) { if (!label_scan_open(dev)) {
log_error("Error opening device %s for writing at %llu length %u.", log_error("Error opening device %s for writing at %llu length %u.",