bin/51151: du hardlinkmatching is slow - fix included
Peter van Dijk
peter at dataloss.nl
Sun Apr 20 03:40:16 PDT 2003
The following reply was made to PR bin/51151; it has been noted by GNATS.
From: Peter van Dijk <peter at dataloss.nl>
To: David Schultz <das at FreeBSD.org>
Cc: FreeBSD-gnats-submit at FreeBSD.org
Subject: Re: bin/51151: du hardlinkmatching is slow - fix included
Date: Sun, 20 Apr 2003 12:35:12 +0200
On Sun, Apr 20, 2003 at 02:51:49AM -0700, David Schultz wrote:
[snip]
> In libc, there are hcreate(3) and friends, which work nicely except
> for their limitation of one hash table per module. That shouldn't
> be an issue here. Alternatively, you could roll your own easily
> enough. Here's some pseudocode using chaining:
I tried hcreate but it failed miserably. I may investigate that some
more (it seemed to misbehave on my input) and send-pr about it.
I intend to roll my own with open addressing indeed.
> hval = hash(ino, dev);
> for (p = table[hval]; p != NULL; p = p->next)
> if (p->ino == ino && p->dev == dev)
> return (1);
> p = malloc(sizeof(hashent));
> p->next = table[hval];
> p->ino = ino;
> p->dev = dev;
> talbe[hval] = p;
Indeed, it shouldn't be hard :)
Greetz, Peter
--
peter at dataloss.nl | ~ we care a lot: about the war we're fighting
www.dataloss.nl | - gee that looks like fun! (Faith no more)
UnderNet/#clue |
| iraqbodycount.net: min 1878, max 2325
More information about the freebsd-bugs
mailing list