Commit 02fd3c79 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Implement a getxid method that doesn't require full resurrection

of zombie objects.
parent 4f479297
......@@ -365,6 +365,35 @@ smp_loaded_st(const struct smp_sc *sc, const struct smp_seg *sg,
return (0);
}
/*---------------------------------------------------------------------
* objcore methods for persistent objects
*/
static unsigned __match_proto__(getxid_f)
smp_oc_getxid(struct worker *wrk, struct objcore *oc)
{
struct object *o;
struct smp_seg *sg;
struct smp_object *so;
(void)wrk;
CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC);
CAST_OBJ_NOTNULL(sg, oc->priv, SMP_SEG_MAGIC);
so = smp_find_so(sg, oc->priv2);
o = (void*)(sg->sc->base + so->ptr);
/*
* The object may not be in this segment since we allocate it
* In a separate operation than the smp_object. We could check
* that it is in a later segment, but that would be complicated.
* XXX: For now, be happy if it is inside th silo
*/
ASSERT_PTR_IN_SILO(sg->sc, o);
CHECK_OBJ_NOTNULL(o, OBJECT_MAGIC);
return (o->xid);
}
/*---------------------------------------------------------------------
* objcore methods for persistent objects
*/
......@@ -506,6 +535,7 @@ smp_oc_getlru(const struct objcore *oc)
}
static struct objcore_methods smp_oc_methods = {
.getxid = smp_oc_getxid,
.getobj = smp_oc_getobj,
.updatemeta = smp_oc_updatemeta,
.freeobj = smp_oc_freeobj,
......
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