Commit 2c20289d authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Assert polishing

parent 2e22c1c3
......@@ -52,7 +52,6 @@ obj_getmethods(const struct objcore *oc)
{
CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC);
AN(oc->stobj->stevedore);
CHECK_OBJ_NOTNULL(oc->stobj->stevedore, STEVEDORE_MAGIC);
AN(oc->stobj->stevedore->methods);
return (oc->stobj->stevedore->methods);
......@@ -61,10 +60,11 @@ obj_getmethods(const struct objcore *oc)
static struct object *
obj_getobj(struct worker *wrk, struct objcore *oc)
{
const struct storeobj_methods *m = obj_getmethods(oc);
const struct storeobj_methods *m;
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC);
m = obj_getmethods(oc);
AN(m->getobj);
return (m->getobj(wrk, oc));
}
......
......@@ -396,11 +396,12 @@ smp_oc_getobj(struct worker *wrk, struct objcore *oc)
uint64_t l;
int bad;
/* Some calls are direct, but they should match anyway */
assert(oc->stobj->stevedore->methods->getobj == smp_oc_getobj);
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC);
AN(oc->stobj->stevedore);
/* Some calls are direct, but they should match anyway */
assert(oc->stobj->stevedore->methods->getobj == smp_oc_getobj);
CAST_OBJ_NOTNULL(sg, oc->stobj->priv, SMP_SEG_MAGIC);
so = smp_find_so(sg, oc->stobj->priv2);
......
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