FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 03-17-2010, 06:14 AM
Nikanth Karthikesan
 
Default multipath: display average priority as group priority

Display avg priority as group priority

Now average priority is used as path group priority, instead of sum of
priorities of the paths. But while displaying group priority, sum is
being displayed. Change it to print the average priority.

When there are no enabled paths, print 0 as priority.

Signed-off-by: Nikanth Karthikesan <knikanth@suse.de>

---

diff --git a/libmultipath/print.c b/libmultipath/print.c
index 10e5ce5..9753fe2 100644
--- a/libmultipath/print.c
+++ b/libmultipath/print.c
@@ -378,6 +378,7 @@ 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.
@@ -385,7 +386,9 @@ snprint_pg_pri (char * buff, size_t len, struct pathgroup * pgp)
* Printing is another reason to update.
*/
path_group_prio_update(pgp);
- return snprint_int(buff, len, pgp->priority);
+ if (pgp->enabled_paths)
+ avg_priority = pgp->priority / pgp->enabled_paths;
+ return snprint_int(buff, len, avg_priority);
}

static int

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 03-17-2010, 06:26 AM
Hannes Reinecke
 
Default multipath: display average priority as group priority

Nikanth Karthikesan wrote:
> Display avg priority as group priority
>
> Now average priority is used as path group priority, instead of sum of
> priorities of the paths. But while displaying group priority, sum is
> being displayed. Change it to print the average priority.
>
> When there are no enabled paths, print 0 as priority.
>
> Signed-off-by: Nikanth Karthikesan <knikanth@suse.de>
Acked-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
--
Dr. Hannes Reinecke zSeries & Storage
hare@suse.de +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Markus Rex, HRB 16746 (AG Nürnberg)

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 03-17-2010, 08:49 PM
Christophe Varoqui
 
Default multipath: display average priority as group priority

> Now average priority is used as path group priority, instead of sum of
> priorities of the paths. But while displaying group priority, sum is
> being displayed. Change it to print the average priority.
>
> When there are no enabled paths, print 0 as priority.
>
Applied.
Thanks.

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 

Thread Tools




All times are GMT. The time now is 06:21 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org