version 1.1.2.9, 2006/03/24 13:48:10 |
version 1.1.2.10, 2006/03/24 14:02:24 |
|
|
static int cycle_target; |
static int cycle_target; |
static int cycle_target_frac; |
static int cycle_target_frac; |
|
|
static struct bucket *buckets; |
static struct bucket static_bucket; |
static size_t hashsize; |
static struct bucket *buckets = &static_bucket; |
|
static size_t hashsize = 1; |
|
|
static int coldadj; |
static int coldadj; |
#define COLDTARGET_ADJ(d) coldadj += (d) |
#define COLDTARGET_ADJ(d) coldadj += (d) |
Line 421 clockpro_hashinit(uint64_t n) |
|
Line 422 clockpro_hashinit(uint64_t n) |
|
buckets = newbuckets; |
buckets = newbuckets; |
hashsize = sz; |
hashsize = sz; |
/* XXX unlock */ |
/* XXX unlock */ |
if (oldbuckets) { |
if (oldbuckets != &static_bucket) { |
clockpro_hashfree(oldbuckets, oldsz); |
clockpro_hashfree(oldbuckets, oldsz); |
} |
} |
} |
} |
Line 430 static struct bucket * |
|
Line 431 static struct bucket * |
|
nonresident_getbucket(objid_t obj, off_t idx) |
nonresident_getbucket(objid_t obj, off_t idx) |
{ |
{ |
uint32_t hash; |
uint32_t hash; |
static struct bucket static_bucket; |
|
|
|
if (hashsize == 0) { |
|
return &static_bucket; |
|
} |
|
|
|
hash = pageidentityhash1(obj, idx); |
hash = pageidentityhash1(obj, idx); |
return &buckets[hash % hashsize]; |
return &buckets[hash % hashsize]; |