From: phk Date: Wed, 19 Nov 2008 10:10:16 +0000 (+0000) Subject: Rename some objhead pointers from obj to oh for consistency. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7a0f7362f68bcd66deee5a2cbd9b04aaf2580579;p=varnish Rename some objhead pointers from obj to oh for consistency. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3403 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache_hash.c b/varnish-cache/bin/varnishd/cache_hash.c index 3cc144b1..f03d02fa 100644 --- a/varnish-cache/bin/varnishd/cache_hash.c +++ b/varnish-cache/bin/varnishd/cache_hash.c @@ -137,7 +137,7 @@ HSH_Freestore(struct object *o) } 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 @@ HSH_Compare(const struct sess *sp, const struct objhead *obj) 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 @@ HSH_Compare(const struct sess *sp, const struct objhead *obj) } 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 @@ HSH_Copy(const struct sess *sp, const struct objhead *obj) *b++ = '#'; } *b++ = '\0'; - assert(b <= obj->hash + obj->hashlen); + assert(b <= oh->hash + oh->hashlen); } struct object * diff --git a/varnish-cache/bin/varnishd/hash_simple_list.c b/varnish-cache/bin/varnishd/hash_simple_list.c index 1f20ffa5..ac2ff68c 100644 --- a/varnish-cache/bin/varnishd/hash_simple_list.c +++ b/varnish-cache/bin/varnishd/hash_simple_list.c @@ -116,13 +116,13 @@ hsl_lookup(const struct sess *sp, struct objhead *noh) */ 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);