r5540 - trunk/varnish-cache/bin/varnishd
phk at varnish-cache.org
phk at varnish-cache.org
Mon Nov 15 11:39:18 CET 2010
Author: phk
Date: 2010-11-15 11:39:18 +0100 (Mon, 15 Nov 2010)
New Revision: 5540
Modified:
trunk/varnish-cache/bin/varnishd/cache_expire.c
trunk/varnish-cache/bin/varnishd/cache_hash.c
trunk/varnish-cache/bin/varnishd/hash_slinger.h
Log:
Make HSH_Ref() take an objcore instead of an object.
Modified: trunk/varnish-cache/bin/varnishd/cache_expire.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_expire.c 2010-11-15 10:19:52 UTC (rev 5539)
+++ trunk/varnish-cache/bin/varnishd/cache_expire.c 2010-11-15 10:39:18 UTC (rev 5540)
@@ -128,8 +128,8 @@
CHECK_OBJ_NOTNULL(o->objcore, OBJCORE_MAGIC);
AN(ObjIsBusy(o));
assert(o->cacheable);
- HSH_Ref(o);
oc = o->objcore;
+ HSH_Ref(oc);
assert(o->entered != 0 && !isnan(o->entered));
o->last_lru = o->entered;
Modified: trunk/varnish-cache/bin/varnishd/cache_hash.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_hash.c 2010-11-15 10:19:52 UTC (rev 5539)
+++ trunk/varnish-cache/bin/varnishd/cache_hash.c 2010-11-15 10:39:18 UTC (rev 5540)
@@ -607,17 +607,16 @@
}
void
-HSH_Ref(const struct object *o)
+HSH_Ref(struct objcore *oc)
{
struct objhead *oh;
- CHECK_OBJ_NOTNULL(o, OBJECT_MAGIC);
- CHECK_OBJ_NOTNULL(o->objcore, OBJCORE_MAGIC);
- oh = o->objcore->objhead;
+ CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC);
+ oh = oc->objhead;
CHECK_OBJ_NOTNULL(oh, OBJHEAD_MAGIC);
Lck_Lock(&oh->mtx);
- assert(o->objcore->refcnt > 0);
- o->objcore->refcnt++;
+ assert(oc->refcnt > 0);
+ oc->refcnt++;
Lck_Unlock(&oh->mtx);
}
Modified: trunk/varnish-cache/bin/varnishd/hash_slinger.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/hash_slinger.h 2010-11-15 10:19:52 UTC (rev 5539)
+++ trunk/varnish-cache/bin/varnishd/hash_slinger.h 2010-11-15 10:39:18 UTC (rev 5540)
@@ -56,7 +56,7 @@
void HSH_Freestore(struct object *o);
struct objcore *HSH_Lookup(struct sess *sp, struct objhead **poh);
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);
double HSH_Grace(double g);
void HSH_Init(void);
More information about the varnish-commit
mailing list