Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
44a35137
Commit
44a35137
authored
May 27, 2017
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hide struct dstat from vmods.
parent
ee58cb23
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
35 additions
and
28 deletions
+35
-28
cache.h
bin/varnishd/cache/cache.h
+5
-17
cache_hash.c
bin/varnishd/cache/cache_hash.c
+5
-4
cache_obj.c
bin/varnishd/cache/cache_obj.c
+2
-2
cache_pool.c
bin/varnishd/cache/cache_pool.c
+2
-2
cache_priv.h
bin/varnishd/cache/cache_priv.h
+12
-0
cache_wrk.c
bin/varnishd/cache/cache_wrk.c
+6
-0
hash_slinger.h
bin/varnishd/hash/hash_slinger.h
+2
-2
storage_persistent_silo.c
bin/varnishd/storage/storage_persistent_silo.c
+1
-1
No files found.
bin/varnishd/cache/cache.h
View file @
44a35137
...
...
@@ -250,18 +250,6 @@ struct acct_bereq {
/*--------------------------------------------------------------------*/
#define L0(t, n)
#define L1(t, n) t n;
#define VSC_FF(n,t,l,s,f,v,d,e) L##l(t, n)
struct
dstat
{
unsigned
summs
;
#include "tbl/vsc_f_main.h"
};
#undef L0
#undef L1
/*--------------------------------------------------------------------*/
struct
vsl_log
{
uint32_t
*
wlb
,
*
wlp
,
*
wle
;
unsigned
wlr
;
...
...
@@ -315,7 +303,7 @@ struct worker {
struct
objhead
*
nobjhead
;
struct
objcore
*
nobjcore
;
void
*
nhashpriv
;
struct
dstat
stats
[
1
]
;
struct
dstat
*
stats
;
struct
vsl_log
*
vsl
;
// borrowed from req/bo
struct
pool_task
task
;
...
...
@@ -860,8 +848,8 @@ void *MPL_Get(struct mempool *mpl, unsigned *size);
void
MPL_Free
(
struct
mempool
*
mpl
,
void
*
item
);
/* cache_obj.c */
struct
objcore
*
ObjNew
(
struct
worker
*
);
void
ObjDestroy
(
struct
worker
*
,
struct
objcore
**
);
struct
objcore
*
ObjNew
(
const
struct
worker
*
);
void
ObjDestroy
(
const
struct
worker
*
,
struct
objcore
**
);
typedef
int
objiterate_f
(
void
*
priv
,
int
flush
,
const
void
*
ptr
,
ssize_t
len
);
int
ObjIterate
(
struct
worker
*
,
struct
objcore
*
,
void
*
priv
,
objiterate_f
*
func
,
int
final
);
...
...
@@ -920,8 +908,8 @@ const char *sess_close_2str(enum sess_close sc, int want_desc);
int
Pool_Task
(
struct
pool
*
pp
,
struct
pool_task
*
task
,
enum
task_prio
prio
);
int
Pool_Task_Arg
(
struct
worker
*
,
enum
task_prio
,
task_func_t
*
,
const
void
*
arg
,
size_t
arg_len
);
void
Pool_Sumstat
(
struct
worker
*
w
);
int
Pool_TrySumstat
(
struct
worker
*
wrk
);
void
Pool_Sumstat
(
const
struct
worker
*
w
);
int
Pool_TrySumstat
(
const
struct
worker
*
wrk
);
void
Pool_PurgeStat
(
unsigned
nobj
);
int
Pool_Task_Any
(
struct
pool_task
*
task
,
enum
task_prio
prio
);
...
...
bin/varnishd/cache/cache_hash.c
View file @
44a35137
...
...
@@ -72,7 +72,8 @@ struct rush {
static
const
struct
hash_slinger
*
hash
;
static
struct
objhead
*
private_oh
;
static
void
hsh_rush1
(
struct
worker
*
,
struct
objhead
*
,
struct
rush
*
,
int
);
static
void
hsh_rush1
(
const
struct
worker
*
,
struct
objhead
*
,
struct
rush
*
,
int
);
static
void
hsh_rush2
(
struct
worker
*
,
struct
rush
*
);
/*---------------------------------------------------------------------*/
...
...
@@ -116,7 +117,7 @@ hsh_prealloc(struct worker *wrk)
/*---------------------------------------------------------------------*/
struct
objcore
*
HSH_Private
(
struct
worker
*
wrk
)
HSH_Private
(
const
struct
worker
*
wrk
)
{
struct
objcore
*
oc
;
...
...
@@ -156,7 +157,7 @@ HSH_Cleanup(struct worker *wrk)
}
void
HSH_DeleteObjHead
(
struct
worker
*
wrk
,
struct
objhead
*
oh
)
HSH_DeleteObjHead
(
const
struct
worker
*
wrk
,
struct
objhead
*
oh
)
{
AZ
(
oh
->
refcnt
);
...
...
@@ -529,7 +530,7 @@ HSH_Lookup(struct req *req, struct objcore **ocp, struct objcore **bocp,
*/
static
void
hsh_rush1
(
struct
worker
*
wrk
,
struct
objhead
*
oh
,
struct
rush
*
r
,
int
max
)
hsh_rush1
(
const
struct
worker
*
wrk
,
struct
objhead
*
oh
,
struct
rush
*
r
,
int
max
)
{
unsigned
u
;
struct
req
*
req
;
...
...
bin/varnishd/cache/cache_obj.c
View file @
44a35137
...
...
@@ -132,7 +132,7 @@ obj_deleteboc(struct boc **p)
*/
struct
objcore
*
ObjNew
(
struct
worker
*
wrk
)
ObjNew
(
const
struct
worker
*
wrk
)
{
struct
objcore
*
oc
;
...
...
@@ -155,7 +155,7 @@ ObjNew(struct worker *wrk)
*/
void
ObjDestroy
(
struct
worker
*
wrk
,
struct
objcore
**
p
)
ObjDestroy
(
const
struct
worker
*
wrk
,
struct
objcore
**
p
)
{
struct
objcore
*
oc
;
...
...
bin/varnishd/cache/cache_pool.c
View file @
44a35137
...
...
@@ -64,7 +64,7 @@ pool_sumstat(const struct dstat *src)
}
void
Pool_Sumstat
(
struct
worker
*
wrk
)
Pool_Sumstat
(
const
struct
worker
*
wrk
)
{
Lck_Lock
(
&
wstat_mtx
);
...
...
@@ -74,7 +74,7 @@ Pool_Sumstat(struct worker *wrk)
}
int
Pool_TrySumstat
(
struct
worker
*
wrk
)
Pool_TrySumstat
(
const
struct
worker
*
wrk
)
{
if
(
Lck_Trylock
(
&
wstat_mtx
))
return
(
0
);
...
...
bin/varnishd/cache/cache_priv.h
View file @
44a35137
...
...
@@ -31,6 +31,18 @@
#include "VSC_main.h"
/*--------------------------------------------------------------------*/
#define L0(t, n)
#define L1(t, n) t n;
#define VSC_FF(n,t,l,s,f,v,d,e) L##l(t, n)
struct
dstat
{
unsigned
summs
;
#include "tbl/vsc_f_main.h"
};
#undef L0
#undef L1
/* Prototypes etc ----------------------------------------------------*/
/* cache_acceptor.c */
...
...
bin/varnishd/cache/cache_wrk.c
View file @
44a35137
...
...
@@ -61,10 +61,13 @@ wrk_bgthread(void *arg)
{
struct
bgthread
*
bt
;
struct
worker
wrk
;
struct
dstat
ds
;
CAST_OBJ_NOTNULL
(
bt
,
arg
,
BGTHREAD_MAGIC
);
THR_SetName
(
bt
->
name
);
INIT_OBJ
(
&
wrk
,
WORKER_MAGIC
);
memset
(
&
ds
,
0
,
sizeof
ds
);
wrk
.
stats
=
&
ds
;
(
void
)
bt
->
func
(
&
wrk
,
bt
->
priv
);
...
...
@@ -93,6 +96,7 @@ static void
WRK_Thread
(
struct
pool
*
qp
,
size_t
stacksize
,
unsigned
thread_workspace
)
{
struct
worker
*
w
,
ww
;
struct
dstat
ds
;
unsigned
char
ws
[
thread_workspace
];
uintptr_t
u
;
...
...
@@ -104,6 +108,8 @@ WRK_Thread(struct pool *qp, size_t stacksize, unsigned thread_workspace)
w
=
&
ww
;
INIT_OBJ
(
w
,
WORKER_MAGIC
);
w
->
lastused
=
NAN
;
memset
(
&
ds
,
0
,
sizeof
ds
);
w
->
stats
=
&
ds
;
AZ
(
pthread_cond_init
(
&
w
->
cond
,
NULL
));
WS_Init
(
w
->
aws
,
"wrk"
,
ws
,
thread_workspace
);
...
...
bin/varnishd/hash/hash_slinger.h
View file @
44a35137
...
...
@@ -74,7 +74,7 @@ void HSH_Purge(struct worker *, struct objhead *, double ttl, double grace,
void
HSH_config
(
const
char
*
h_arg
);
struct
boc
*
HSH_RefBoc
(
const
struct
objcore
*
);
void
HSH_DerefBoc
(
struct
worker
*
wrk
,
struct
objcore
*
);
struct
objcore
*
HSH_Private
(
struct
worker
*
wrk
);
struct
objcore
*
HSH_Private
(
const
struct
worker
*
wrk
);
void
HSH_Abandon
(
struct
objcore
*
oc
);
int
HSH_Snipe
(
const
struct
worker
*
,
struct
objcore
*
);
void
HSH_Kill
(
struct
objcore
*
);
...
...
@@ -107,7 +107,7 @@ struct objhead {
void
HSH_Fail
(
struct
objcore
*
);
void
HSH_Unbusy
(
struct
worker
*
,
struct
objcore
*
);
void
HSH_DeleteObjHead
(
struct
worker
*
,
struct
objhead
*
);
void
HSH_DeleteObjHead
(
const
struct
worker
*
,
struct
objhead
*
);
int
HSH_DerefObjHead
(
struct
worker
*
,
struct
objhead
**
);
int
HSH_DerefObjCore
(
struct
worker
*
,
struct
objcore
**
,
int
);
#define HSH_RUSH_POLICY -1
...
...
bin/varnishd/storage/storage_persistent_silo.c
View file @
44a35137
...
...
@@ -389,7 +389,7 @@ smp_loaded_st(const struct smp_sc *sc, const struct smp_seg *sg,
* objcore methods for persistent objects
*/
struct
object
*
struct
object
*
__match_proto__
(
sml_getobj_f
)
smp_sml_getobj
(
struct
worker
*
wrk
,
struct
objcore
*
oc
)
{
struct
object
*
o
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment