diff options
author | David Teigland <teigland@redhat.com> | 2017-08-25 15:31:19 -0500 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2017-10-23 15:17:33 -0500 |
commit | 069832d69b00e0b1ee8bf57a5c71fea658ef6abd (patch) | |
tree | 6484778f377d3738957fac7d13523e2cddf0d249 | |
parent | 997f2be84f686f277089d06123b9a3545d705d56 (diff) | |
download | lvm2-069832d69b00e0b1ee8bf57a5c71fea658ef6abd.tar.gz |
scanning: remove references to async reads
Now that label_read_data structs are used for both
sync and async reads.
-rw-r--r-- | lib/format_text/import.c | 28 | ||||
-rw-r--r-- | lib/format_text/text_label.c | 9 |
2 files changed, 18 insertions, 19 deletions
diff --git a/lib/format_text/import.c b/lib/format_text/import.c index 1a62ea3dd..bbb2eb208 100644 --- a/lib/format_text/import.c +++ b/lib/format_text/import.c @@ -46,21 +46,21 @@ int text_read_metadata_summary(const struct format_type *fmt, { struct dm_config_tree *cft; struct text_vg_version_ops **vsn; - char *buf_async = NULL; + char *buf = NULL; int r = 0; if (ld) { if (ld->buf_len >= (offset + size)) - buf_async = ld->buf; + buf = ld->buf; else { /* - * Needs data beyond the end of the async read buffer. + * Needs data beyond the end of the ld buffer. * Will do a new synchronous read to get the data. * (scan_size could also be made larger.) */ - log_debug_metadata("async read buffer for %s too small %u for metadata offset %llu size %u", + log_debug_metadata("label scan buffer for %s too small %u for metadata offset %llu size %u", dev_name(dev), ld->buf_len, (unsigned long long)offset, size); - buf_async = NULL; + buf = NULL; } } @@ -70,7 +70,7 @@ int text_read_metadata_summary(const struct format_type *fmt, return_0; if (dev) { - if (buf_async) + if (buf) log_debug_metadata("Copying metadata summary for %s at %llu size %d (+%d)", dev_name(dev), (unsigned long long)offset, size, size2); @@ -79,7 +79,7 @@ int text_read_metadata_summary(const struct format_type *fmt, dev_name(dev), (unsigned long long)offset, size, size2); - if (!config_file_read_fd(cft, dev, buf_async, offset, size, + if (!config_file_read_fd(cft, dev, buf, offset, size, offset2, size2, checksum_fn, vgsummary->mda_checksum, checksum_only, 1)) { @@ -139,7 +139,7 @@ struct volume_group *text_read_metadata(struct format_instance *fid, struct volume_group *vg = NULL; struct dm_config_tree *cft; struct text_vg_version_ops **vsn; - char *buf_async = NULL; + char *buf = NULL; int skip_parse; /* @@ -172,21 +172,21 @@ struct volume_group *text_read_metadata(struct format_instance *fid, if (ld) { if (ld->buf_len >= (offset + size)) - buf_async = ld->buf; + buf = ld->buf; else { /* - * Needs data beyond the end of the async read buffer. + * Needs data beyond the end of the ld buffer. * Will do a new synchronous read to get the data. * (scan_size could also be made larger.) */ - log_debug_metadata("async read buffer for %s too small %u for metadata offset %llu size %u", + log_debug_metadata("label scan buffer for %s too small %u for metadata offset %llu size %u", dev_name(dev), ld->buf_len, (unsigned long long)offset, size); - buf_async = NULL; + buf = NULL; } } if (dev) { - if (buf_async) + if (buf) log_debug_metadata("Copying metadata for %s at %llu size %d (+%d)", dev_name(dev), (unsigned long long)offset, size, size2); @@ -195,7 +195,7 @@ struct volume_group *text_read_metadata(struct format_instance *fid, dev_name(dev), (unsigned long long)offset, size, size2); - if (!config_file_read_fd(cft, dev, buf_async, offset, size, + if (!config_file_read_fd(cft, dev, buf, offset, size, offset2, size2, checksum_fn, checksum, skip_parse, 1)) { /* FIXME: handle errors */ diff --git a/lib/format_text/text_label.c b/lib/format_text/text_label.c index 0d03d7b2b..17be60bd6 100644 --- a/lib/format_text/text_label.c +++ b/lib/format_text/text_label.c @@ -367,11 +367,10 @@ close_dev: } /* - * When label_read_data *ld is set, it means that we - * have asynchronously read the first ld->buf_len bytes - * of the device and already have that data, so we don't - * need do do any dev_read's (as long as the desired - * dev_read offset+size is less then ld->buf_len). + * When label_read_data *ld is set, it means that we have read the first + * ld->buf_len bytes of the device and already have that data, so we don't need + * to do any dev_read's (as long as the desired dev_read offset+size is less + * then ld->buf_len). */ static int _text_read(struct labeller *l, struct device *dev, void *label_buf, |