summaryrefslogtreecommitdiffstats
path: root/libdm/datastruct
diff options
context:
space:
mode:
authorAlasdair Kergon <agk@redhat.com>2008-05-21 16:14:46 +0000
committerAlasdair Kergon <agk@redhat.com>2008-05-21 16:14:46 +0000
commitb947f3439347341f930288822e7c292adb2c6e0e (patch)
treeb555f124ca600e61b81b360843c95758d5767c89 /libdm/datastruct
parentace5664e7d51c87be424ede60d1ad2e3df9e50cc (diff)
downloadlvm2-b947f3439347341f930288822e7c292adb2c6e0e.tar.gz
lvm2-b947f3439347341f930288822e7c292adb2c6e0e.tar.xz
lvm2-b947f3439347341f930288822e7c292adb2c6e0e.zip
Skip add_dev_node when ioctls disabled.
Make dm_hash_iter safe against deletion. Accept a NULL pointer to dm_free silently.
Diffstat (limited to 'libdm/datastruct')
-rw-r--r--libdm/datastruct/hash.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libdm/datastruct/hash.c b/libdm/datastruct/hash.c
index 8f0b82f9..8fd3e60c 100644
--- a/libdm/datastruct/hash.c
+++ b/libdm/datastruct/hash.c
@@ -215,12 +215,14 @@ unsigned dm_hash_get_num_entries(struct dm_hash_table *t)
void dm_hash_iter(struct dm_hash_table *t, dm_hash_iterate_fn f)
{
- struct dm_hash_node *c;
+ struct dm_hash_node *c, *n;
unsigned i;
for (i = 0; i < t->num_slots; i++)
- for (c = t->slots[i]; c; c = c->next)
+ for (c = t->slots[i]; c; c = n) {
+ n = c->next;
f(c->data);
+ }
}
void dm_hash_wipe(struct dm_hash_table *t)