From: Sven Verdoolaege Date: Mon, 22 Oct 2007 07:07:50 GMT Subject: Re: [PATCH, take 1] Linear-time/space rename logic (exact renames only) Message-ID: <20071022070750.GM1179MdfPADPa@greensroom.kotnet.org> In-Reply-To: On Sun, Oct 21, 2007 at 04:59:03PM -0700, Linus Torvalds wrote: > +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