Re: [PATCH, take 1] Linear-time/space rename logic (exact renames only)
- From
- Sven Verdoolaege <skimo@kotnet.org>
- Date
- Oct 22, 2007, 07:07 UTC
- Message-ID
- <20071022070750.GM1179MdfPADPa@greensroom.kotnet.org>
- In-Reply-To
- <alpine.LFD.0.999.0710211603200.10525@woody.linux-foundation.org>
On Sun, Oct 21, 2007 at 04:59:03PM -0700, Linus Torvalds wrote:
Show 17 quoted lines
> +static int find_same_files(void *ptr)
> +{
> + struct file_similarity *p = ptr;
> + struct file_similarity *src = NULL, *dst = NULL;
> +
> + /* Split the hash list up into sources and destinations */
> + do {
> + struct file_similarity *entry = p;
> + p = p->next;
> + if (entry->src_dst < 0) {
> + entry->next = src;
> + src = entry;
> + } else {
> + entry->next = dst;
> + dst = entry;
> + }
> + } while (p);Aren't you truncating the ptr list after the first entry here? (While you still need the whole list in free_file_table.)
skimo