Date: Sun, 20 Apr 2003 03:40:13 -0700 (PDT) From: Peter van Dijk <peter@dataloss.nl> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/51151: du hardlinkmatching is slow - fix included Message-ID: <200304201040.h3KAeDRA036799@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/51151; it has been noted by GNATS. From: Peter van Dijk <peter@dataloss.nl> To: David Schultz <das@FreeBSD.org> Cc: FreeBSD-gnats-submit@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@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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200304201040.h3KAeDRA036799>