]> sourceware.org Git - lvm2.git/commitdiff
Cease recognising snapshot-in-use percentages returned by early development kernels.
authorAlasdair Kergon <agk@redhat.com>
Tue, 15 Jul 2008 00:25:52 +0000 (00:25 +0000)
committerAlasdair Kergon <agk@redhat.com>
Tue, 15 Jul 2008 00:25:52 +0000 (00:25 +0000)
WHATS_NEW
lib/activate/dev_manager.c
lib/metadata/segtype.h
lib/mirror/mirrored.c
lib/snapshot/snapshot.c

index caa1ceb45bbc962024a48070e795cb7698ca6bdb..3bac05317ebb4bd2f5a6b82cca46561c48a65555 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,6 +1,7 @@
 Version 2.02.40 - 
 ================================
-  Add "flags" metadata field (akin to "status") for backward-compatible flags.
+  Cease recognising snapshot-in-use percentages returned by early devt kernels.
+  Add backward-compatible flags field to on-disk format_text metadata.
   Fix dmeventd monitoring libraries to link against liblvm2cmd again. (2.02.39)
 
 Version 2.02.39 - 27th June 2008
index 1b010b69dbe8cbf7a51e452edbf99c14ce9b6498..a081dad73cbaa4efb0a007f5d5878bfde56f1e31 100644 (file)
@@ -379,8 +379,7 @@ static int _percent_run(struct dev_manager *dm, const char *name,
                    !segtype->ops->target_percent(&dm->target_state, dm->mem,
                                                  dm->cmd, seg, params,
                                                  &total_numerator,
-                                                 &total_denominator,
-                                                 percent))
+                                                 &total_denominator))
                        goto_out;
 
        } while (next);
@@ -393,7 +392,7 @@ static int _percent_run(struct dev_manager *dm, const char *name,
 
        if (total_denominator)
                *percent = (float) total_numerator *100 / total_denominator;
-       else if (*percent < 0)
+       else
                *percent = 100;
 
        log_debug("LV percent: %f", *percent);
index fa668dc168e6aa58c50574ada5d56fde71ee08a9..ba9dc6e86d85d74c1507f24aacda18f0b151fba1 100644 (file)
@@ -77,7 +77,7 @@ struct segtype_handler {
                               struct cmd_context *cmd,
                               struct lv_segment *seg, char *params,
                               uint64_t *total_numerator,
-                              uint64_t *total_denominator, float *percent);
+                              uint64_t *total_denominator);
        int (*target_present) (const struct lv_segment *seg,
                               unsigned *attributes);
        int (*modules_needed) (struct dm_pool *mem,
index 56213fb226a311404ffc6e6d31177f9e2fef3fc7..cbf2b77e1aa005d8f650ad508ee5077b60a4e058 100644 (file)
@@ -176,8 +176,7 @@ static struct mirror_state *_mirrored_init_target(struct dm_pool *mem,
 static int _mirrored_target_percent(void **target_state, struct dm_pool *mem,
                           struct cmd_context *cmd, struct lv_segment *seg,
                           char *params, uint64_t *total_numerator,
-                          uint64_t *total_denominator,
-                          float *percent __attribute((unused)))
+                          uint64_t *total_denominator)
 {
        struct mirror_state *mirr_state;
        uint64_t numerator, denominator;
index 6437970c74d5da992456c8937d94d109ddac6b76..911bb21a8fc5e384f2d2449355c1a2deaf674e73 100644 (file)
@@ -95,20 +95,14 @@ static int _snap_target_percent(void **target_state __attribute((unused)),
                           struct cmd_context *cmd __attribute((unused)),
                           struct lv_segment *seg __attribute((unused)),
                           char *params, uint64_t *total_numerator,
-                          uint64_t *total_denominator, float *percent)
+                          uint64_t *total_denominator)
 {
-       float percent2;
        uint64_t numerator, denominator;
 
-       if (strchr(params, '/')) {
-               if (sscanf(params, "%" PRIu64 "/%" PRIu64,
-                          &numerator, &denominator) == 2) {
-                       *total_numerator += numerator;
-                       *total_denominator += denominator;
-               }
-       } else if (sscanf(params, "%f", &percent2) == 1) {
-               *percent += percent2;
-               *percent /= 2;
+       if (sscanf(params, "%" PRIu64 "/%" PRIu64,
+                  &numerator, &denominator) == 2) {
+               *total_numerator += numerator;
+               *total_denominator += denominator;
        }
 
        return 1;
This page took 0.039228 seconds and 5 git commands to generate.