Revert "Display avg priority as group priority"
authorChristophe Varoqui <christophe.varoqui@opensvc.com>
Wed, 9 Jan 2013 07:41:51 +0000 (08:41 +0100)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Wed, 9 Jan 2013 07:41:51 +0000 (08:41 +0100)
This reverts commit 750db1f0dc08bf1d96ce64d32786dfe07b8ae3f9.

Do not compute pathgroup average priority twice on print.
Caught by Mike Christie.

libmultipath/print.c

index a29b885..0e2c680 100644 (file)
@@ -381,7 +381,6 @@ snprint_pg_selector (char * buff, size_t len, struct pathgroup * pgp)
 static int
 snprint_pg_pri (char * buff, size_t len, struct pathgroup * pgp)
 {
-       int avg_priority = 0;
        /*
         * path group priority is not updated for every path prio change,
         * but only on switch group code path.
@@ -389,9 +388,7 @@ snprint_pg_pri (char * buff, size_t len, struct pathgroup * pgp)
         * Printing is another reason to update.
         */
        path_group_prio_update(pgp);
-       if (pgp->enabled_paths)
-               avg_priority = pgp->priority / pgp->enabled_paths;
-       return snprint_int(buff, len, avg_priority);
+       return snprint_int(buff, len, pgp->priority);
 }
 
 static int