Re: and there's a routine for *sorting* a kernel linked list as well

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Nov 21, 2010 at 02:23:18AM -0500, Robert P. J. Day wrote:
> 
>   what started off as just some nonchalant poking around in kernel
> data structures has become moderately educational.  i had no idea that
> there is support for *sorting* the nodes of a kernel LL in
> <linux/list_sort.h>:
> 
> 
> void list_sort(void *priv, struct list_head *head,
>                int (*cmp)(void *priv, struct list_head *a,
>                           struct list_head *b));
> 
> 
>   doesn't seem to be a lot of folks using that:

It's very new.  The drm code needed it, so they took it from the xfs
code and made it common code.

>   i wonder how much kernel code manually sorts a linked list, not
> realizing that there's kernel library support for that.

Hopefully none other, if you find some please feel free to convert it to
use the core code.

thanks,

greg k-h

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux