Fix hash table deletion to prevent lost entries
authorPeter Barada <peter.barada@logicpd.com>
Mon, 21 Mar 2011 23:05:20 +0000 (19:05 -0400)
committerWolfgang Denk <wd@denx.de>
Tue, 22 Mar 2011 21:43:04 +0000 (22:43 +0100)
commitc81c1222427f268d29ba999c82e2477c428e7bab
tree18c778da5db8d12452a01abe4ef8316ecce7b77e
parent5e987ddf855b959f1f112da49082e3c4235cef59
Fix hash table deletion to prevent lost entries

Use negative used value to mark deleted entry.  Search keeps probing
past deleted entries.  Adding an entry uses first deleted entry when
it hits end of probe chain.

Initially found that "ramdiskimage" and "preboot" collide modulus 347,
causing "preboot" to be inserted at idx 190, "ramdiskimage" at idx 191.
Previous to this fix when "preboot" is deleted, "ramdiskimage" is
orphaned.

Signed-off-by: Peter Barada <peter.barada@logicpd.com>
Tested-by: Wolfgang Denk <wd@denx.de>
lib/hashtable.c