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

Style and consistency fixes.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@5578 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 814ebbc9
......@@ -249,7 +249,7 @@ hsh_testmagic(void *result)
fprintf(stderr, ">\n");
}
/**********************************************************************
/*---------------------------------------------------------------------
* Insert an object which magically appears out of nowhere or, more likely,
* comes off some persistent storage device.
*/
......@@ -295,7 +295,7 @@ HSH_Insert(const struct sess *sp)
return (oc);
}
/**********************************************************************
/*---------------------------------------------------------------------
*/
struct objcore *
......@@ -454,7 +454,7 @@ HSH_Lookup(struct sess *sp, struct objhead **poh)
return (oc);
}
/**********************************************************************
/*---------------------------------------------------------------------
*/
static void
......@@ -484,7 +484,7 @@ hsh_rush(struct objhead *oh)
}
}
/**********************************************************************
/*---------------------------------------------------------------------
* Purge an entire objhead
*/
......@@ -542,7 +542,7 @@ HSH_Purge(const struct sess *sp, struct objhead *oh, double ttl, double grace)
}
/**********************************************************************
/*---------------------------------------------------------------------
* Kill a busy object we don't need anyway.
* There may be sessions on the waiting list, so we cannot just blow
* it out of the water.
......@@ -612,7 +612,7 @@ HSH_Ref(struct objcore *oc)
Lck_Unlock(&oh->mtx);
}
/*******************************************************************
/*--------------------------------------------------------------------
* Dereference objcore and or object
*
* Can deal with:
......@@ -693,7 +693,7 @@ HSH_Deref(struct worker *w, struct objcore *oc, struct object **oo)
return (0);
}
/*******************************************************************
/*--------------------------------------------------------------------
* This one is slightly tricky. This is called from the BAN module
* to try to wash the object which holds the oldest ban.
* We compete against HSH_Deref() which comes in the opposite
......
......@@ -51,7 +51,7 @@ SVNID("$Id$")
#include "cache_waiter.h"
/**********************************************************************/
/*--------------------------------------------------------------------*/
static pthread_t vca_kqueue_thread;
......
......@@ -45,7 +45,7 @@ SVNID("$Id$")
static struct lock hcb_mtx;
/**********************************************************************
/*---------------------------------------------------------------------
* Table for finding out how many bits two bytes have in common,
* counting from the MSB towards the LSB.
* ie:
......@@ -80,7 +80,7 @@ hcb_build_bittbl(void)
assert(hcb_bits(0x10, 0x0b) == 3);
}
/**********************************************************************
/*---------------------------------------------------------------------
* For space reasons we overload the two pointers with two different
* kinds of of pointers. We cast them to uintptr_t's and abuse the
* low two bits to tell them apart, assuming that Varnish will never
......@@ -113,7 +113,7 @@ static VSTAILQ_HEAD(, hcb_y) dead_y = VSTAILQ_HEAD_INITIALIZER(dead_y);
static VTAILQ_HEAD(, objhead) cool_h = VTAILQ_HEAD_INITIALIZER(cool_h);
static VTAILQ_HEAD(, objhead) dead_h = VTAILQ_HEAD_INITIALIZER(dead_h);
/**********************************************************************
/*---------------------------------------------------------------------
* Pointer accessor functions
*/
static int
......@@ -165,7 +165,7 @@ hcb_l_y(uintptr_t u)
return ((struct hcb_y *)(u & ~HCB_BIT_Y));
}
/**********************************************************************
/*---------------------------------------------------------------------
* Find the "critical" bit that separates these two digests
*/
......@@ -186,7 +186,7 @@ hcb_crit_bit(const struct objhead *oh1, const struct objhead *oh2,
return (y->critbit);
}
/*********************************************************************
/*---------------------------------------------------------------------
* Unless we have the lock, we need to be very careful about pointer
* references into the tree, we cannot trust things to be the same
* in two consequtive memory accesses.
......@@ -267,7 +267,7 @@ hcb_insert(struct worker *wrk, struct hcb_root *root, struct objhead *oh, int ha
return(oh);
}
/**********************************************************************/
/*--------------------------------------------------------------------*/
static void
hcb_delete(struct hcb_root *r, struct objhead *oh)
......@@ -299,7 +299,7 @@ hcb_delete(struct hcb_root *r, struct objhead *oh)
}
}
/**********************************************************************/
/*--------------------------------------------------------------------*/
static void
dumptree(struct cli *cli, uintptr_t p, int indent)
......@@ -343,7 +343,7 @@ static struct cli_proto hcb_cmds[] = {
{ NULL }
};
/**********************************************************************/
/*--------------------------------------------------------------------*/
static void *
hcb_cleaner(void *priv)
......@@ -376,7 +376,7 @@ hcb_cleaner(void *priv)
NEEDLESS_RETURN(NULL);
}
/**********************************************************************/
/*--------------------------------------------------------------------*/
static void
hcb_start(void)
......
......@@ -55,7 +55,7 @@ static const struct stevedore * volatile stv_next;
static struct stevedore *stv_transient;
/*********************************************************************
/*--------------------------------------------------------------------
* NB! Dirty trick alert:
*
* We use a captive objcore as tail senteniel for LRU lists, but to
......@@ -76,7 +76,7 @@ LRU_Alloc(void)
return (l);
}
/*********************************************************************
/*--------------------------------------------------------------------
* XXX: trust pointer writes to be atomic
*/
......@@ -97,7 +97,7 @@ stv_pick_stevedore(void)
return (stv);
}
/*********************************************************************/
/*-------------------------------------------------------------------*/
static struct storage *
stv_alloc(const struct sess *sp, size_t size)
......@@ -143,7 +143,7 @@ stv_alloc(const struct sess *sp, size_t size)
}
/*********************************************************************
/*-------------------------------------------------------------------*
* Structure used to transport internal knowledge from STV_NewObject()
* to STV_MkObject(). Nobody else should mess with this struct.
*/
......@@ -157,7 +157,7 @@ struct stv_objsecrets {
double ttl;
};
/*********************************************************************
/*--------------------------------------------------------------------
* This function is called by stevedores ->allocobj() method, which
* very often will be stv_default_allocobj() below, to convert a slab
* of storage into object which the stevedore can then register in its
......@@ -212,7 +212,7 @@ STV_MkObject(struct sess *sp, void *ptr, unsigned ltot,
return (o);
}
/*********************************************************************
/*--------------------------------------------------------------------
* This is the default ->allocobj() which all stevedores who do not
* implement persistent storage can rely on.
*/
......@@ -235,7 +235,7 @@ stv_default_allocobj(struct stevedore *stv, struct sess *sp, unsigned ltot,
return (o);
}
/*********************************************************************/
/*-------------------------------------------------------------------*/
struct object *
STV_NewObject(struct sess *sp, unsigned wsl, double ttl, unsigned nhttp)
......@@ -305,7 +305,7 @@ struct objcore_methods default_oc_methods = {
.freeobj = default_oc_freeobj,
};
/*********************************************************************/
/*-------------------------------------------------------------------*/
struct storage *
STV_alloc(const struct sess *sp, size_t size)
......@@ -353,10 +353,12 @@ STV_close(void)
{
struct stevedore *stv;
VTAILQ_FOREACH(stv, &stevedores, list) {
VTAILQ_FOREACH(stv, &stevedores, list)
if (stv->close != NULL)
stv->close(stv);
}
stv = stv_transient;
if (stv->close != NULL)
stv->close(stv);
}
struct lru *
......@@ -367,6 +369,11 @@ STV_lru(const struct storage *st)
return (st->stevedore->lru);
}
/*--------------------------------------------------------------------
* Parse a stevedore argument on the form:
* [ name '=' ] strategy [ ',' arg ] *
*/
static const struct choice STV_choice[] = {
{ "file", &smf_stevedore },
{ "malloc", &sma_stevedore },
......@@ -377,11 +384,6 @@ static const struct choice STV_choice[] = {
{ NULL, NULL }
};
/*--------------------------------------------------------------------
* Parse a stevedore argument on the form:
* [ name '=' ] strategy [ ',' arg ] *
*/
void
STV_Config(const char *spec)
{
......@@ -471,6 +473,7 @@ STV_Config_Transient(void)
{
const struct stevedore *stv;
ASSERT_MGT();
VTAILQ_FOREACH(stv, &stevedores, list)
if (!strcmp(stv->name, TRANSIENT_NAME))
return;
......
......@@ -227,7 +227,7 @@ STV_FileSize(int fd, const char *size, unsigned *granularity, const char *ctx)
" to %ju (80%% of available disk space)\n", ctx, l);
}
if (sizeof(void *) == 4 && l > INT32_MAX) { /*lint !e506 !e774 */
if (sizeof(void *) == 4 && l > INT32_MAX) { /*lint !e506 !e774 !e845 */
fprintf(stderr,
"NB: Storage size limited to 2GB on 32 bit architecture,\n"
"NB: otherwise we could run out of address space.\n"
......
......@@ -183,7 +183,7 @@ struct smp_sc {
*/
static VTAILQ_HEAD(,smp_sc) silos = VTAILQ_HEAD_INITIALIZER(silos);
/*********************************************************************
/*--------------------------------------------------------------------
* SIGNATURE functions
* The signature is SHA256 over:
* 1. The smp_sign struct up to but not including the length field.
......
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