r3613 - branches/2.0/varnish-cache/bin/varnishd

tfheen at projects.linpro.no tfheen at projects.linpro.no
Thu Feb 5 12:31:24 CET 2009


Author: tfheen
Date: 2009-02-05 12:31:24 +0100 (Thu, 05 Feb 2009)
New Revision: 3613

Modified:
   branches/2.0/varnish-cache/bin/varnishd/cache_hash.c
   branches/2.0/varnish-cache/bin/varnishd/hash_simple_list.c
Log:
Merge r3403: Rename some objhead pointers from obj to oh for consistency.



Modified: branches/2.0/varnish-cache/bin/varnishd/cache_hash.c
===================================================================
--- branches/2.0/varnish-cache/bin/varnishd/cache_hash.c	2009-02-05 11:27:00 UTC (rev 3612)
+++ branches/2.0/varnish-cache/bin/varnishd/cache_hash.c	2009-02-05 11:31:24 UTC (rev 3613)
@@ -137,7 +137,7 @@
 }
 
 int
-HSH_Compare(const struct sess *sp, const struct objhead *obj)
+HSH_Compare(const struct sess *sp, const struct objhead *oh)
 {
 	int i;
 	unsigned u, v;
@@ -145,11 +145,11 @@
 
 	CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
 	CHECK_OBJ_NOTNULL(sp->wrk, WORKER_MAGIC);
-	CHECK_OBJ_NOTNULL(obj, OBJHEAD_MAGIC);
-	i = sp->lhashptr - obj->hashlen;
+	CHECK_OBJ_NOTNULL(oh, OBJHEAD_MAGIC);
+	i = sp->lhashptr - oh->hashlen;
 	if (i)
 		return (i);
-	b = obj->hash;
+	b = oh->hash;
 	for (u = 0; u < sp->ihashptr; u += 2) {
 		v = pdiff(sp->hashptr[u], sp->hashptr[u + 1]);
 		i = memcmp(sp->hashptr[u], b, v);
@@ -162,18 +162,21 @@
 	}
 	assert(*b == '\0');
 	b++;
-	assert(b == obj->hash + obj->hashlen);
+	assert(b == oh->hash + oh->hashlen);
 	return (0);
 }
 
 void
-HSH_Copy(const struct sess *sp, const struct objhead *obj)
+HSH_Copy(const struct sess *sp, const struct objhead *oh)
 {
 	unsigned u, v;
 	char *b;
 
-	assert(obj->hashlen >= sp->lhashptr);
-	b = obj->hash;
+	CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
+	CHECK_OBJ_NOTNULL(oh, OBJHEAD_MAGIC);
+
+	assert(oh->hashlen >= sp->lhashptr);
+	b = oh->hash;
 	for (u = 0; u < sp->ihashptr; u += 2) {
 		v = pdiff(sp->hashptr[u], sp->hashptr[u + 1]);
 		memcpy(b, sp->hashptr[u], v);
@@ -181,7 +184,7 @@
 		*b++ = '#';
 	}
 	*b++ = '\0';
-	assert(b <= obj->hash + obj->hashlen);
+	assert(b <= oh->hash + oh->hashlen);
 }
 
 struct object *

Modified: branches/2.0/varnish-cache/bin/varnishd/hash_simple_list.c
===================================================================
--- branches/2.0/varnish-cache/bin/varnishd/hash_simple_list.c	2009-02-05 11:27:00 UTC (rev 3612)
+++ branches/2.0/varnish-cache/bin/varnishd/hash_simple_list.c	2009-02-05 11:31:24 UTC (rev 3613)
@@ -116,13 +116,13 @@
  */
 
 static int
-hsl_deref(const struct objhead *obj)
+hsl_deref(const struct objhead *oh)
 {
 	struct hsl_entry *he;
 	int ret;
 
-	AN(obj->hashpriv);
-	he = obj->hashpriv;
+	AN(oh->hashpriv);
+	he = oh->hashpriv;
 	Lck_Lock(&hsl_mtx);
 	if (--he->refcnt == 0) {
 		VTAILQ_REMOVE(&hsl_head, he, list);



More information about the varnish-commit mailing list