libmultipath: consolidate group_by_* functions
authorBenjamin Marzinski <bmarzins@redhat.com>
Fri, 23 Aug 2019 17:48:51 +0000 (12:48 -0500)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Tue, 1 Oct 2019 19:58:32 +0000 (21:58 +0200)
commita0556a6c1b7a2a91a3ff3c59cb89eb9ab4181f71
treeab76e0eef27d3d898ee04784ae306bb6a79ad8b7
parent9a6c4e8920a9f08c131120205992cf638082f947
libmultipath: consolidate group_by_* functions

group_by_node_name() and group_by_serial() are exactly the same except
for how the paths are compared. group_by_prio() is different but its
pathvec solves the same issue as the bitmap from the other two
functions, and since we are always running sort_pathgroups() after
calling pgpriorityfn, there is no need to sort the pathgroups in
group_by_prio(). This means that all three functions can be replaced
with one function, group_by_match() that takes a match function as an
argument.

Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
libmultipath/pgpolicies.c