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

Minor cleanups.

parent fd0ff2b0
......@@ -205,6 +205,7 @@ ved_pretend_gzip(const struct sess *sp, const uint8_t *p, ssize_t l)
l -= lx;
p += lx;
}
/* buf2 is local, have to flush */
(void)WRW_Flush(sp->wrk);
}
......
......@@ -53,7 +53,51 @@ static VTAILQ_HEAD(, stevedore) stevedores =
static const struct stevedore * volatile stv_next;
static struct stevedore *stv_transient;
static struct objcore_methods default_oc_methods;
/*---------------------------------------------------------------------
* Default objcore methods
*/
static struct object * __match_proto__(getobj_f)
default_oc_getobj(struct worker *wrk, struct objcore *oc)
{
struct object *o;
(void)wrk;
if (oc->priv == NULL)
return (NULL);
CAST_OBJ_NOTNULL(o, oc->priv, OBJECT_MAGIC);
return (o);
}
static void
default_oc_freeobj(struct objcore *oc)
{
struct object *o;
CAST_OBJ_NOTNULL(o, oc->priv, OBJECT_MAGIC);
oc->priv = NULL;
oc->methods = NULL;
STV_Freestore(o);
STV_free(o->objstore);
}
static struct lru *
default_oc_getlru(const struct objcore *oc)
{
struct object *o;
CAST_OBJ_NOTNULL(o, oc->priv, OBJECT_MAGIC);
return (o->objstore->stevedore->lru);
}
static struct objcore_methods default_oc_methods = {
.getobj = default_oc_getobj,
.freeobj = default_oc_freeobj,
.getlru = default_oc_getlru,
};
/*--------------------------------------------------------------------
*/
......@@ -306,50 +350,6 @@ STV_Freestore(struct object *o)
}
}
/*---------------------------------------------------------------------
* Default objcore methods
*/
static struct object * __match_proto__(getobj_f)
default_oc_getobj(struct worker *wrk, struct objcore *oc)
{
struct object *o;
(void)wrk;
if (oc->priv == NULL)
return (NULL);
CAST_OBJ_NOTNULL(o, oc->priv, OBJECT_MAGIC);
return (o);
}
static void
default_oc_freeobj(struct objcore *oc)
{
struct object *o;
CAST_OBJ_NOTNULL(o, oc->priv, OBJECT_MAGIC);
oc->priv = NULL;
oc->methods = NULL;
STV_Freestore(o);
STV_free(o->objstore);
}
static struct lru *
default_oc_getlru(const struct objcore *oc)
{
struct object *o;
CAST_OBJ_NOTNULL(o, oc->priv, OBJECT_MAGIC);
return (o->objstore->stevedore->lru);
}
static struct objcore_methods default_oc_methods = {
.getobj = default_oc_getobj,
.freeobj = default_oc_freeobj,
.getlru = default_oc_getlru,
};
/*-------------------------------------------------------------------*/
struct storage *
......
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