Commit 9a5c6dd5 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Make HSH_Ref() take an objcore instead of an object.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@5540 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 0f6e82c5
...@@ -128,8 +128,8 @@ EXP_Insert(struct object *o) ...@@ -128,8 +128,8 @@ EXP_Insert(struct object *o)
CHECK_OBJ_NOTNULL(o->objcore, OBJCORE_MAGIC); CHECK_OBJ_NOTNULL(o->objcore, OBJCORE_MAGIC);
AN(ObjIsBusy(o)); AN(ObjIsBusy(o));
assert(o->cacheable); assert(o->cacheable);
HSH_Ref(o);
oc = o->objcore; oc = o->objcore;
HSH_Ref(oc);
assert(o->entered != 0 && !isnan(o->entered)); assert(o->entered != 0 && !isnan(o->entered));
o->last_lru = o->entered; o->last_lru = o->entered;
......
...@@ -607,17 +607,16 @@ HSH_Unbusy(const struct sess *sp) ...@@ -607,17 +607,16 @@ HSH_Unbusy(const struct sess *sp)
} }
void void
HSH_Ref(const struct object *o) HSH_Ref(struct objcore *oc)
{ {
struct objhead *oh; struct objhead *oh;
CHECK_OBJ_NOTNULL(o, OBJECT_MAGIC); CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC);
CHECK_OBJ_NOTNULL(o->objcore, OBJCORE_MAGIC); oh = oc->objhead;
oh = o->objcore->objhead;
CHECK_OBJ_NOTNULL(oh, OBJHEAD_MAGIC); CHECK_OBJ_NOTNULL(oh, OBJHEAD_MAGIC);
Lck_Lock(&oh->mtx); Lck_Lock(&oh->mtx);
assert(o->objcore->refcnt > 0); assert(oc->refcnt > 0);
o->objcore->refcnt++; oc->refcnt++;
Lck_Unlock(&oh->mtx); Lck_Unlock(&oh->mtx);
} }
......
...@@ -56,7 +56,7 @@ void HSH_Cleanup(struct worker *w); ...@@ -56,7 +56,7 @@ void HSH_Cleanup(struct worker *w);
void HSH_Freestore(struct object *o); void HSH_Freestore(struct object *o);
struct objcore *HSH_Lookup(struct sess *sp, struct objhead **poh); struct objcore *HSH_Lookup(struct sess *sp, struct objhead **poh);
void HSH_Unbusy(const struct sess *sp); void HSH_Unbusy(const struct sess *sp);
void HSH_Ref(const struct object *o); void HSH_Ref(struct objcore *o);
void HSH_Drop(struct sess *sp); void HSH_Drop(struct sess *sp);
double HSH_Grace(double g); double HSH_Grace(double g);
void HSH_Init(void); void HSH_Init(void);
......
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