Emap: Drop szind/slab splitting parameters.
After the previous diff, these are constants.
This commit is contained in:
parent
50289750b3
commit
bb6a418523
@ -110,11 +110,9 @@ struct emap_prepare_s {
|
|||||||
* state appropriately.
|
* state appropriately.
|
||||||
*/
|
*/
|
||||||
bool emap_split_prepare(tsdn_t *tsdn, emap_t *emap, emap_prepare_t *prepare,
|
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,
|
edata_t *edata, size_t size_a, edata_t *trail, size_t size_b);
|
||||||
size_t size_b, szind_t szind_b, bool slab_b);
|
|
||||||
void emap_split_commit(tsdn_t *tsdn, emap_t *emap, emap_prepare_t *prepare,
|
void emap_split_commit(tsdn_t *tsdn, emap_t *emap, emap_prepare_t *prepare,
|
||||||
edata_t *lead, size_t size_a, szind_t szind_a, bool slab_a, edata_t *trail,
|
edata_t *lead, size_t size_a, edata_t *trail, size_t size_b);
|
||||||
size_t size_b, szind_t szind_b, bool slab_b);
|
|
||||||
void emap_merge_prepare(tsdn_t *tsdn, emap_t *emap, emap_prepare_t *prepare,
|
void emap_merge_prepare(tsdn_t *tsdn, emap_t *emap, emap_prepare_t *prepare,
|
||||||
edata_t *lead, edata_t *trail);
|
edata_t *lead, edata_t *trail);
|
||||||
void emap_merge_commit(tsdn_t *tsdn, emap_t *emap, emap_prepare_t *prepare,
|
void emap_merge_commit(tsdn_t *tsdn, emap_t *emap, emap_prepare_t *prepare,
|
||||||
|
20
src/emap.c
20
src/emap.c
@ -230,8 +230,7 @@ void emap_remap(tsdn_t *tsdn, emap_t *emap, edata_t *edata, szind_t szind,
|
|||||||
|
|
||||||
bool
|
bool
|
||||||
emap_split_prepare(tsdn_t *tsdn, emap_t *emap, emap_prepare_t *prepare,
|
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,
|
edata_t *edata, size_t size_a, edata_t *trail, size_t size_b) {
|
||||||
size_t size_b, szind_t szind_b, bool slab_b) {
|
|
||||||
EMAP_DECLARE_RTREE_CTX;
|
EMAP_DECLARE_RTREE_CTX;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -240,7 +239,7 @@ emap_split_prepare(tsdn_t *tsdn, emap_t *emap, emap_prepare_t *prepare,
|
|||||||
* facilitate a lookup.
|
* facilitate a lookup.
|
||||||
*/
|
*/
|
||||||
edata_t lead;
|
edata_t lead;
|
||||||
edata_init(&lead, 0U, edata_addr_get(edata), size_a, slab_a, szind_a, 0,
|
edata_init(&lead, 0U, edata_addr_get(edata), size_a, false, 0, 0,
|
||||||
extent_state_active, false, false, false, EXTENT_NOT_HEAD);
|
extent_state_active, false, false, false, EXTENT_NOT_HEAD);
|
||||||
|
|
||||||
emap_rtree_leaf_elms_lookup(tsdn, emap, rtree_ctx, &lead, false, true,
|
emap_rtree_leaf_elms_lookup(tsdn, emap, rtree_ctx, &lead, false, true,
|
||||||
@ -257,12 +256,19 @@ emap_split_prepare(tsdn_t *tsdn, emap_t *emap, emap_prepare_t *prepare,
|
|||||||
|
|
||||||
void
|
void
|
||||||
emap_split_commit(tsdn_t *tsdn, emap_t *emap, emap_prepare_t *prepare,
|
emap_split_commit(tsdn_t *tsdn, emap_t *emap, emap_prepare_t *prepare,
|
||||||
edata_t *lead, size_t size_a, szind_t szind_a, bool slab_a, edata_t *trail,
|
edata_t *lead, size_t size_a, edata_t *trail, size_t size_b) {
|
||||||
size_t size_b, szind_t szind_b, bool slab_b) {
|
/*
|
||||||
|
* We should think about not writing to the lead leaf element. We can
|
||||||
|
* get into situations where a racing realloc-like call can disagree
|
||||||
|
* with a size lookup request. I think it's fine to declare that these
|
||||||
|
* situations are race bugs, but there's an argument to be made that for
|
||||||
|
* things like xallocx, a size lookup call should return either the old
|
||||||
|
* size or the new size, but not anything else.
|
||||||
|
*/
|
||||||
emap_rtree_write_acquired(tsdn, emap, prepare->lead_elm_a,
|
emap_rtree_write_acquired(tsdn, emap, prepare->lead_elm_a,
|
||||||
prepare->lead_elm_b, lead, szind_a, slab_a);
|
prepare->lead_elm_b, lead, SC_NSIZES, /* slab */ false);
|
||||||
emap_rtree_write_acquired(tsdn, emap, prepare->trail_elm_a,
|
emap_rtree_write_acquired(tsdn, emap, prepare->trail_elm_a,
|
||||||
prepare->trail_elm_b, trail, szind_b, slab_b);
|
prepare->trail_elm_b, trail, SC_NSIZES, /* slab */ false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1190,8 +1190,7 @@ extent_split_impl(tsdn_t *tsdn, pa_shard_t *shard, ehooks_t *ehooks,
|
|||||||
EXTENT_NOT_HEAD);
|
EXTENT_NOT_HEAD);
|
||||||
emap_prepare_t prepare;
|
emap_prepare_t prepare;
|
||||||
bool err = emap_split_prepare(tsdn, shard->emap, &prepare, edata,
|
bool err = emap_split_prepare(tsdn, shard->emap, &prepare, edata,
|
||||||
size_a, SC_NSIZES, /* slab */ false, trail, size_b, SC_NSIZES,
|
size_a, trail, size_b);
|
||||||
/* slab */ false);
|
|
||||||
if (err) {
|
if (err) {
|
||||||
goto label_error_b;
|
goto label_error_b;
|
||||||
}
|
}
|
||||||
@ -1206,8 +1205,8 @@ extent_split_impl(tsdn_t *tsdn, pa_shard_t *shard, ehooks_t *ehooks,
|
|||||||
}
|
}
|
||||||
|
|
||||||
edata_size_set(edata, size_a);
|
edata_size_set(edata, size_a);
|
||||||
emap_split_commit(tsdn, shard->emap, &prepare, edata, size_a, SC_NSIZES,
|
emap_split_commit(tsdn, shard->emap, &prepare, edata, size_a, trail,
|
||||||
/* slab_a */ false, trail, size_b,SC_NSIZES, /* slab_b */ false);
|
size_b);
|
||||||
|
|
||||||
emap_unlock_edata2(tsdn, shard->emap, edata, trail);
|
emap_unlock_edata2(tsdn, shard->emap, edata, trail);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user