Extent: Remove szind/slab knowledge.
This commit is contained in:
committed by
David Goldblatt
parent
dc26b30094
commit
50289750b3
@@ -28,6 +28,9 @@ struct emap_full_alloc_ctx_s {
|
||||
|
||||
bool emap_init(emap_t *emap, base_t *base, bool zeroed);
|
||||
|
||||
void emap_remap(tsdn_t *tsdn, emap_t *emap, edata_t *edata, szind_t szind,
|
||||
bool slab);
|
||||
|
||||
/*
|
||||
* Grab the lock or locks associated with the edata or edatas indicated (which
|
||||
* is done just by simple address hashing). The hashing strategy means that
|
||||
@@ -106,8 +109,6 @@ struct emap_prepare_s {
|
||||
* higher-addressed one. It's the caller's responsibility to set the edata
|
||||
* state appropriately.
|
||||
*/
|
||||
void emap_remap(tsdn_t *tsdn, emap_t *emap, edata_t *edata, szind_t szind,
|
||||
bool slab);
|
||||
bool emap_split_prepare(tsdn_t *tsdn, emap_t *emap, emap_prepare_t *prepare,
|
||||
edata_t *edata, size_t size_a, szind_t szind_a, bool slab_a, edata_t *trail,
|
||||
size_t size_b, szind_t szind_b, bool slab_b);
|
||||
|
@@ -20,19 +20,16 @@
|
||||
extern size_t opt_lg_extent_max_active_fit;
|
||||
|
||||
edata_t *ecache_alloc(tsdn_t *tsdn, pa_shard_t *shard, ehooks_t *ehooks,
|
||||
ecache_t *ecache, void *new_addr, size_t size, size_t alignment, bool slab,
|
||||
szind_t szind, bool zero);
|
||||
ecache_t *ecache, void *new_addr, size_t size, size_t alignment, bool zero);
|
||||
edata_t *ecache_alloc_grow(tsdn_t *tsdn, pa_shard_t *shard, ehooks_t *ehooks,
|
||||
ecache_t *ecache, void *new_addr, size_t size, size_t alignment, bool slab,
|
||||
szind_t szind, bool zero);
|
||||
ecache_t *ecache, void *new_addr, size_t size, size_t alignment, bool zero);
|
||||
void ecache_dalloc(tsdn_t *tsdn, pa_shard_t *shard, ehooks_t *ehooks,
|
||||
ecache_t *ecache, edata_t *edata);
|
||||
edata_t *ecache_evict(tsdn_t *tsdn, pa_shard_t *shard, ehooks_t *ehooks,
|
||||
ecache_t *ecache, size_t npages_min);
|
||||
|
||||
edata_t *extent_alloc_wrapper(tsdn_t *tsdn, pa_shard_t *shard, ehooks_t *ehooks,
|
||||
void *new_addr, size_t size, size_t alignment, bool slab, szind_t szind,
|
||||
bool zero, bool *commit);
|
||||
void *new_addr, size_t size, size_t alignment, bool zero, bool *commit);
|
||||
void extent_dalloc_gap(tsdn_t *tsdn, pa_shard_t *shard, ehooks_t *ehooks,
|
||||
edata_t *edata);
|
||||
void extent_dalloc_wrapper(tsdn_t *tsdn, pa_shard_t *shard, ehooks_t *ehooks,
|
||||
@@ -48,8 +45,7 @@ bool extent_purge_lazy_wrapper(tsdn_t *tsdn, ehooks_t *ehooks, edata_t *edata,
|
||||
bool extent_purge_forced_wrapper(tsdn_t *tsdn, ehooks_t *ehooks, edata_t *edata,
|
||||
size_t offset, size_t length);
|
||||
edata_t *extent_split_wrapper(tsdn_t *tsdn, pa_shard_t *shard,
|
||||
ehooks_t *ehooks, edata_t *edata, size_t size_a, szind_t szind_a,
|
||||
bool slab_a, size_t size_b, szind_t szind_b, bool slab_b);
|
||||
ehooks_t *ehooks, edata_t *edata, size_t size_a, size_t size_b);
|
||||
bool extent_merge_wrapper(tsdn_t *tsdn, pa_shard_t *shard, ehooks_t *ehooks,
|
||||
edata_t *a, edata_t *b);
|
||||
|
||||
|
@@ -198,13 +198,13 @@ edata_t *pa_alloc(tsdn_t *tsdn, pa_shard_t *shard, size_t size,
|
||||
size_t alignment, bool slab, szind_t szind, bool zero);
|
||||
/* Returns true on error, in which case nothing changed. */
|
||||
bool pa_expand(tsdn_t *tsdn, pa_shard_t *shard, edata_t *edata, size_t old_size,
|
||||
size_t new_size, szind_t szind, bool slab, bool zero);
|
||||
size_t new_size, szind_t szind, bool zero);
|
||||
/*
|
||||
* The same. Sets *generated_dirty to true if we produced new dirty pages, and
|
||||
* false otherwise.
|
||||
*/
|
||||
bool pa_shrink(tsdn_t *tsdn, pa_shard_t *shard, edata_t *edata, size_t old_size,
|
||||
size_t new_size, szind_t szind, bool slab, bool *generated_dirty);
|
||||
size_t new_size, szind_t szind, bool *generated_dirty);
|
||||
/*
|
||||
* Frees the given edata back to the pa. Sets *generated_dirty if we produced
|
||||
* new dirty pages (well, we alwyas set it for now; but this need not be the
|
||||
|
@@ -334,16 +334,12 @@ rtree_leaf_elm_lookup(tsdn_t *tsdn, rtree_t *rtree, rtree_ctx_t *rtree_ctx,
|
||||
static inline bool
|
||||
rtree_write(tsdn_t *tsdn, rtree_t *rtree, rtree_ctx_t *rtree_ctx, uintptr_t key,
|
||||
edata_t *edata, szind_t szind, bool slab) {
|
||||
/* Use rtree_clear() to set the edata to NULL. */
|
||||
assert(edata != NULL);
|
||||
|
||||
rtree_leaf_elm_t *elm = rtree_leaf_elm_lookup(tsdn, rtree, rtree_ctx,
|
||||
key, false, true);
|
||||
if (elm == NULL) {
|
||||
return true;
|
||||
}
|
||||
|
||||
assert(rtree_leaf_elm_read(tsdn, rtree, elm, false).edata == NULL);
|
||||
rtree_contents_t contents;
|
||||
contents.edata = edata;
|
||||
contents.metadata.szind = szind;
|
||||
|
Reference in New Issue
Block a user