xfs
[Top] [All Lists]

Re: [PATCH] sort: Introduce generic list_sort function

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH] sort: Introduce generic list_sort function
From: Andi Kleen <andi@xxxxxxxxxxxxxx>
Date: Tue, 05 Jan 2010 12:31:15 +0100
Cc: xfs@xxxxxxxxxxx, Artem Bityutskiy <dedekind@xxxxxxxxxxxxx>, Dave Airlie <airlied@xxxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx, Adrian Hunter <adrian.hunter@xxxxxxxxx>
In-reply-to: <1262649295-28427-1-git-send-email-david__25057.2445955642$1262651404$gmane$org@xxxxxxxxxxxxx> (Dave Chinner's message of "Tue, 5 Jan 2010 10:54:55 +1100")
References: <1262649295-28427-1-git-send-email-david__25057.2445955642$1262651404$gmane$org@xxxxxxxxxxxxx>
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/22.3 (gnu/linux)
Dave Chinner <david@xxxxxxxxxxxxx> writes:
> +
> +/**
> + * list_sort - sort a list.
> + * @priv: private data, passed to @cmp
> + * @head: the list to sort
> + * @cmp: the elements comparison function
> + *
> + * This function has been implemented by Mark J Roberts <mjr@xxxxxxxx>. It
> + * implements "merge sort" which has O(nlog(n)) complexity. The list is 
> sorted
> + * in ascending order.
> + *
> + * The comparison function @cmp is supposed to return a negative value if @a 
> is
> + * than @b, and a positive value if @a is greater than @b. If @a and @b are
> + * equivalent, then it does not matter what this function returns.
> + */
> +void list_sort(void *priv, struct list_head *head,
> +            int (*cmp)(void *priv, struct list_head *a,
> +                       struct list_head *b))

No EXPORT_SYMBOL? 

Also it would seem cleaner to have it in a own file.

-Andi

-- 
ak@xxxxxxxxxxxxxxx -- Speaking for myself only.

<Prev in Thread] Current Thread [Next in Thread>