[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 28/31: libihash: fix index computation
From: |
Samuel Thibault |
Subject: |
[hurd] 28/31: libihash: fix index computation |
Date: |
Mon, 02 May 2016 23:48:33 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit 74d373342f799a45e9193c2f56189843b7b42c04
Author: Justus Winter <address@hidden>
Date: Thu Apr 28 23:59:26 2016 +0200
libihash: fix index computation
Previously, find_index would return a suboptimal slot if a tombstone
was in the optimal slot.
* libihash/ihash.c (find_index): Fix index computation.
---
libihash/ihash.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/libihash/ihash.c b/libihash/ihash.c
index 4bc54fd..01ba23b 100644
--- a/libihash/ihash.c
+++ b/libihash/ihash.c
@@ -81,15 +81,9 @@ find_index (hurd_ihash_t ht, hurd_ihash_key_t key)
idx = hash (ht, key) & mask;
- if (ht->items[idx].value == _HURD_IHASH_EMPTY
- || compare (ht, ht->items[idx].key, key))
- return idx;
-
up_idx = idx;
-
do
{
- up_idx = (up_idx + 1) & mask;
if (ht->items[up_idx].value == _HURD_IHASH_EMPTY)
return first_deleted_set ? first_deleted : up_idx;
if (compare (ht, ht->items[up_idx].key, key))
@@ -97,6 +91,7 @@ find_index (hurd_ihash_t ht, hurd_ihash_key_t key)
if (! first_deleted_set
&& ht->items[up_idx].value == _HURD_IHASH_DELETED)
first_deleted = up_idx, first_deleted_set = 1;
+ up_idx = (up_idx + 1) & mask;
}
while (up_idx != idx);
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 07/31: utils/settrans: get an authenticated root node in chroot mode, (continued)
- [hurd] 07/31: utils/settrans: get an authenticated root node in chroot mode, Samuel Thibault, 2016/05/02
- [hurd] 06/31: isofs: make superblock detection more robust, Samuel Thibault, 2016/05/02
- [hurd] 08/31: utils/settrans: add option to specify the underlying node, Samuel Thibault, 2016/05/02
- [hurd] 31/31: Fix build, Samuel Thibault, 2016/05/02
- [hurd] 29/31: libihash: keep track of free slots, Samuel Thibault, 2016/05/02
- [hurd] 10/31: mach-defpager: fix error handling, Samuel Thibault, 2016/05/02
- [hurd] 30/31: libihash: rehash if effective load exceeds the threshold, Samuel Thibault, 2016/05/02
- [hurd] 26/31: startup: write all messages to stderr, Samuel Thibault, 2016/05/02
- [hurd] 27/31: Fix root operations on trivfs-translated nodes, Samuel Thibault, 2016/05/02
- [hurd] 16/31: libtrivfs: fix notion of privileged user, Samuel Thibault, 2016/05/02
- [hurd] 28/31: libihash: fix index computation,
Samuel Thibault <=
- [hurd] 24/31: startup: add verbose parameter, Samuel Thibault, 2016/05/02
- [hurd] 25/31: startup: use the generated default server implementations, Samuel Thibault, 2016/05/02
- [hurd] 01/31: netfs: Remove global reference count lock., Samuel Thibault, 2016/05/03
- [hurd] 04/31: Use posix types for mig definitions., Samuel Thibault, 2016/05/03