Commit c8e7c20e authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Call ObjStable() when the boc goes away.

parent c95addc6
......@@ -870,7 +870,7 @@ void *ObjSetattr(struct worker *, struct objcore *, enum obj_attr attr,
ssize_t len, const void *);
int ObjCopyAttr(struct worker *, struct objcore *, struct objcore *,
enum obj_attr attr);
void ObjStable(struct worker *, struct objcore *, struct busyobj *);
void ObjStable(struct worker *, struct objcore *, struct boc *);
int ObjSetDouble(struct worker *, struct objcore *, enum obj_attr, double);
int ObjSetU32(struct worker *, struct objcore *, enum obj_attr, uint32_t);
......
......@@ -177,8 +177,6 @@ VBO_DerefBusyObj(struct worker *wrk, struct busyobj **pbo)
if (bo->fetch_objcore != NULL) {
AN(wrk);
if (bo->fetch_objcore->stobj->stevedore != NULL)
ObjStable(bo->wrk, bo->fetch_objcore, bo);
(void)HSH_DerefObjCore(wrk, &bo->fetch_objcore);
}
......
......@@ -768,6 +768,8 @@ HSH_DerefBusy(struct worker *wrk, struct objcore *oc)
oc->boc = NULL;
Lck_Unlock(&oc->objhead->mtx);
if (r == 0) {
if (oc->stobj->stevedore != NULL)
ObjStable(wrk, oc, boc);
VBO_DerefBusyObj(wrk, &boc->busyobj);
AZ(pthread_cond_destroy(&boc->cond));
Lck_Delete(&boc->mtx);
......
......@@ -256,19 +256,19 @@ ObjUpdateMeta(struct worker *wrk, struct objcore *oc)
}
/*====================================================================
* Called when the busyobj used to populate the objcore is going away.
* Called when the boc used to populate the objcore is going away.
* Useful for releasing any leftovers from Trim.
*/
void
ObjStable(struct worker *wrk, struct objcore *oc, struct busyobj *bo)
ObjStable(struct worker *wrk, struct objcore *oc, struct boc *boc)
{
const struct obj_methods *m = obj_getmethods(oc);
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
CHECK_OBJ_NOTNULL(boc, BOC_MAGIC);
if (m->objstable != NULL)
m->objstable(wrk, oc, bo);
m->objstable(wrk, oc, boc);
}
/*====================================================================
......
......@@ -43,7 +43,7 @@ typedef int objgetspace_f(struct worker *, struct objcore *,
ssize_t *sz, uint8_t **ptr);
typedef void objextend_f(struct worker *, struct objcore *, ssize_t l);
typedef void objtrimstore_f(struct worker *, struct objcore *);
typedef void objstable_f(struct worker *, struct objcore *, struct busyobj *);
typedef void objstable_f(struct worker *, struct objcore *, struct boc *);
typedef void objslim_f(struct worker *, struct objcore *);
typedef void *objgetattr_f(struct worker *, struct objcore *,
enum obj_attr attr, ssize_t *len);
......
......@@ -484,19 +484,19 @@ sml_trimstore(struct worker *wrk, struct objcore *oc)
}
static void __match_proto__(objstable_f)
sml_stable(struct worker *wrk, struct objcore *oc, struct busyobj *bo)
sml_stable(struct worker *wrk, struct objcore *oc, struct boc *boc)
{
const struct stevedore *stv;
struct storage *st;
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC);
CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
CHECK_OBJ_NOTNULL(boc, BOC_MAGIC);
if (bo->boc->stevedore_priv == NULL)
if (boc->stevedore_priv == NULL)
return;
CAST_OBJ_NOTNULL(st, bo->boc->stevedore_priv, STORAGE_MAGIC);
bo->boc->stevedore_priv = 0;
CAST_OBJ_NOTNULL(st, boc->stevedore_priv, STORAGE_MAGIC);
boc->stevedore_priv = 0;
CHECK_OBJ_NOTNULL(st, STORAGE_MAGIC);
stv = oc->stobj->stevedore;
CHECK_OBJ_NOTNULL(stv, STEVEDORE_MAGIC);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment