Deleted ranges were never removed from the ranges hash... this could have finally

nailed down bug #77.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15791 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2006-01-02 13:09:42 +00:00
parent 80be55c442
commit 37675ea580
2 changed files with 6 additions and 4 deletions

View File

@ -8,9 +8,10 @@
#include <KernelExport.h>
#include <util/AutoLock.h>
#include <vm_address_space.h>
#include <vm_page.h>
#include <util/AutoLock.h>
#include <util/khash.h>
#include <string.h>
@ -199,8 +200,9 @@ block_range::New(block_cache *cache, block_range **_range)
memset(range, 0, sizeof(block_range) + cache->chunks_per_range * sizeof(block_chunk));
range->base = address;
// insert into free ranges list in cache
// insert into free ranges list and hash in cache
cache->free_ranges.Add(range);
hash_insert(cache->ranges_hash, range);
*_range = range;
return B_OK;
@ -234,8 +236,9 @@ block_range::Delete(block_cache *cache, block_range *range)
vm_page_set_state(range->pages[i], PAGE_STATE_FREE);
}
// remove from cache free list
// remove from cache free list and hash
cache->free_ranges.Remove(range);
hash_remove(cache->ranges_hash, range);
free(range);
}

View File

@ -222,7 +222,6 @@ block_cache::GetFreeRange()
return NULL;
}
hash_insert(ranges_hash, range);
return range;
}