From: Matt Mackall <mpm@selenic.com>
To: Andrew Morton <akpm@osdl.com>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 3/8] lib/sort: Replace qsort in NFS ACL code
Date: Mon, 31 Jan 2005 01:35:00 -0600 [thread overview]
Message-ID: <4.416337461@selenic.com> (raw)
In-Reply-To: <3.416337461@selenic.com>
Switch NFS ACLs to lib/sort
Index: mm2/fs/nfsacl.c
===================================================================
--- mm2.orig/fs/nfsacl.c 2005-01-30 21:26:27.000000000 -0800
+++ mm2/fs/nfsacl.c 2005-01-30 22:06:43.000000000 -0800
@@ -25,6 +25,7 @@
#include <linux/sunrpc/xdr.h>
#include <linux/nfsacl.h>
#include <linux/nfs3.h>
+#include <linux/sort.h>
MODULE_LICENSE("GPL");
@@ -163,9 +164,10 @@
return 0;
}
-static int
-cmp_acl_entry(const struct posix_acl_entry *a, const struct posix_acl_entry *b)
+static int cmp_acl_entry(const void *x, const void *y)
{
+ const struct posix_acl_entry *a = x, *b = y;
+
if (a->e_tag != b->e_tag)
return a->e_tag - b->e_tag;
else if (a->e_id > b->e_id)
@@ -188,8 +190,8 @@
if (!acl)
return 0;
- qsort(acl->a_entries, acl->a_count, sizeof(struct posix_acl_entry),
- (int(*)(const void *,const void *))cmp_acl_entry);
+ sort(acl->a_entries, acl->a_count, sizeof(struct posix_acl_entry),
+ cmp_acl_entry, 0);
/* Clear undefined identifier fields and find the ACL_GROUP_OBJ
and ACL_MASK entries. */
Index: mm2/fs/Kconfig
===================================================================
--- mm2.orig/fs/Kconfig 2005-01-30 21:32:26.000000000 -0800
+++ mm2/fs/Kconfig 2005-01-30 22:07:10.000000000 -0800
@@ -1428,7 +1428,6 @@
config NFS_ACL
bool "NFS_ACL protocol extension"
depends on NFS_V3
- select QSORT
select FS_POSIX_ACL
help
Implement the NFS_ACL protocol extension for manipulating POSIX
@@ -1513,7 +1512,6 @@
config NFSD_ACL
bool "NFS_ACL protocol extension"
depends on NFSD_V3
- select QSORT
help
Implement the NFS_ACL protocol extension for manipulating POSIX
Access Control Lists on exported file systems. The clients must
next prev parent reply other threads:[~2005-01-31 7:45 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-31 7:34 [PATCH 0/8] lib/sort: Add generic sort to lib/ Matt Mackall
2005-01-31 7:34 ` [PATCH 1/8] lib/sort: Heapsort implementation of sort() Matt Mackall
2005-01-31 7:34 ` [PATCH 2/8] lib/sort: Replace qsort in XFS Matt Mackall
2005-01-31 7:35 ` Matt Mackall [this message]
2005-01-31 7:35 ` [PATCH 4/8] lib/sort: Kill qsort() Matt Mackall
2005-01-31 7:35 ` [PATCH 5/8] lib/sort: Replace open-coded O(pids**2) bubblesort in cpusets Matt Mackall
2005-01-31 7:35 ` [PATCH 6/8] lib/sort: Replace insertion sort in exception tables Matt Mackall
2005-01-31 7:35 ` [PATCH 7/8] lib/sort: Replace insertion sort in IA64 " Matt Mackall
2005-01-31 7:35 ` [PATCH 8/8] lib/sort: Use generic sort on x86_64 Matt Mackall
2005-01-31 12:02 ` [PATCH 5/8] lib/sort: Replace open-coded O(pids**2) bubblesort in cpusets Paul Jackson
2005-02-01 22:29 ` [PATCH 2/8] lib/sort: Replace qsort in XFS Chris Wedgwood
2005-02-01 22:22 ` Randy.Dunlap
2005-02-02 4:31 ` Zan Lynx
2005-02-02 10:48 ` Herbert Xu
2005-02-01 22:48 ` Matt Mackall
2005-01-31 17:16 ` [PATCH 1/8] lib/sort: Heapsort implementation of sort() Andreas Gruenbacher
2005-01-31 17:30 ` Paulo Marques
2005-02-01 17:54 ` Andreas Gruenbacher
2005-02-01 18:11 ` linux-os
2005-02-01 19:04 ` linux-os
2005-02-01 19:47 ` Andreas Gruenbacher
2005-01-31 19:30 ` Matt Mackall
2005-02-01 17:50 ` Andreas Gruenbacher
2005-02-02 1:00 ` Horst von Brand
2005-02-02 10:50 ` Herbert Xu
2005-02-02 11:14 ` Andreas Gruenbacher
2005-02-03 23:19 ` Junio C Hamano
2005-02-01 2:10 ` Horst von Brand
2005-02-27 13:17 ` Andreas Gruenbacher
2005-02-27 21:25 ` Matt Mackall
2005-02-27 21:53 ` Andreas Gruenbacher
2005-02-27 22:10 ` Andreas Gruenbacher
2005-03-01 13:23 ` Andreas Gruenbacher
2005-03-01 19:06 ` Christophe Saout
2005-03-01 20:12 ` Matt Mackall
2005-03-01 21:47 ` Andrew Morton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4.416337461@selenic.com \
--to=mpm@selenic.com \
--cc=akpm@osdl.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox