From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id o05BUT71201567 for ; Tue, 5 Jan 2010 05:30:31 -0600 Received: from one.firstfloor.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 4953E1C2CE85 for ; Tue, 5 Jan 2010 03:31:18 -0800 (PST) Received: from one.firstfloor.org (one.firstfloor.org [213.235.205.2]) by cuda.sgi.com with ESMTP id 8KZTbL888lA7HldS for ; Tue, 05 Jan 2010 03:31:18 -0800 (PST) Subject: Re: [PATCH] sort: Introduce generic list_sort function From: Andi Kleen References: <1262649295-28427-1-git-send-email-david__25057.2445955642$1262651404$gmane$org@fromorbit.com> Date: Tue, 05 Jan 2010 12:31:15 +0100 In-Reply-To: <1262649295-28427-1-git-send-email-david__25057.2445955642$1262651404$gmane$org@fromorbit.com> (Dave Chinner's message of "Tue, 5 Jan 2010 10:54:55 +1100") Message-ID: <87eim4dbzw.fsf@basil.nowhere.org> MIME-Version: 1.0 List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: xfs-bounces@oss.sgi.com Errors-To: xfs-bounces@oss.sgi.com To: Dave Chinner Cc: Artem Bityutskiy , Dave Airlie , Adrian Hunter , linux-kernel@vger.kernel.org, xfs@oss.sgi.com Dave Chinner 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 . 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@linux.intel.com -- Speaking for myself only. _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754214Ab0AELbT (ORCPT ); Tue, 5 Jan 2010 06:31:19 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752395Ab0AELbS (ORCPT ); Tue, 5 Jan 2010 06:31:18 -0500 Received: from one.firstfloor.org ([213.235.205.2]:43040 "EHLO one.firstfloor.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751963Ab0AELbR (ORCPT ); Tue, 5 Jan 2010 06:31:17 -0500 To: Dave Chinner Cc: xfs@oss.sgi.com, Artem Bityutskiy , Dave Airlie , linux-kernel@vger.kernel.org, Adrian Hunter Subject: Re: [PATCH] sort: Introduce generic list_sort function From: Andi Kleen References: <1262649295-28427-1-git-send-email-david__25057.2445955642$1262651404$gmane$org@fromorbit.com> Date: Tue, 05 Jan 2010 12:31:15 +0100 In-Reply-To: <1262649295-28427-1-git-send-email-david__25057.2445955642$1262651404$gmane$org@fromorbit.com> (Dave Chinner's message of "Tue, 5 Jan 2010 10:54:55 +1100") Message-ID: <87eim4dbzw.fsf@basil.nowhere.org> User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/22.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dave Chinner 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 . 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@linux.intel.com -- Speaking for myself only.