[ofa-general] RE: Patches to complib
Todd Rimmer
todd.rimmer at qlogic.com
Wed Jun 20 12:02:26 PDT 2007
> From: Sasha Khapyorsky [mailto:sashak at voltaire.com]
>
> What about cleaner names? Maybe something like get_next_higher() or
just
> get_higher()?
The name comes from the fact for a key already in the list, it was
equivalent to:
p = cl_qmap_get(map, key)
p = cl_qmap_next(p)
However it also handles the case where the key was no longer in the list
or where the starting point is a key which may have never been in the
list.
This makes it very useful for situations like:
lock list
p = cl_qmap_head()
process p
k = p's key
unlock list
do some other stuff
lock list
p = cl_qmap_get_next(..., k)
process p
k = p's key
unlock list
....
Another example use might be a map keyed by GUIDs and a query to find
all devices from a given vendor, in which case get_next could be used to
start the search.
We added this capability to our internal equivalent of complib a few
years ago and found a lot of uses for it. So I thought it would be a
simple yet powerful capability to add to OFED complib.
Todd Rimmer
Chief Architect
QLogic System Interconnect Group
Voice: 610-233-4852 Fax: 610-233-4777
Todd.Rimmer at QLogic.com www.QLogic.com
More information about the general
mailing list