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
cc5380f2
Commit
cc5380f2
authored
Feb 05, 2016
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce the amount of magic for persistent stevedores.
parent
3995e910
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
35 deletions
+11
-35
cache.h
bin/varnishd/cache/cache.h
+0
-1
cache_expire.c
bin/varnishd/cache/cache_expire.c
+3
-27
cache_hash.c
bin/varnishd/cache/cache_hash.c
+1
-1
storage_persistent_silo.c
bin/varnishd/storage/storage_persistent_silo.c
+5
-6
p00005.vtc
bin/varnishtest/tests/p00005.vtc
+2
-0
No files found.
bin/varnishd/cache/cache.h
View file @
cc5380f2
...
...
@@ -682,7 +682,6 @@ void EXP_Clr(struct exp *e);
double
EXP_Ttl
(
const
struct
req
*
,
const
struct
exp
*
);
double
EXP_When
(
const
struct
exp
*
exp
);
void
EXP_Insert
(
struct
worker
*
wrk
,
struct
objcore
*
oc
);
void
EXP_Inject
(
struct
worker
*
wrk
,
struct
objcore
*
oc
);
void
EXP_Rearm
(
struct
objcore
*
,
double
now
,
double
ttl
,
double
grace
,
double
keep
);
void
EXP_Poke
(
struct
objcore
*
);
...
...
bin/varnishd/cache/cache_expire.c
View file @
cc5380f2
...
...
@@ -166,30 +166,6 @@ EXP_Poke(struct objcore *oc)
exp_mail_it
(
oc
,
0
);
}
/*--------------------------------------------------------------------
* Inject an object with a reference into the binheap.
*
* This can either come from a stevedore (persistent) during startup
* or from EXP_Insert() below.
*/
void
EXP_Inject
(
struct
worker
*
wrk
,
struct
objcore
*
oc
)
{
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
CHECK_OBJ_NOTNULL
(
oc
,
OBJCORE_MAGIC
);
AZ
(
oc
->
exp_flags
&
(
OC_EF_INSERT
|
OC_EF_MOVE
));
AZ
(
oc
->
flags
&
OC_F_DYING
);
AZ
(
oc
->
flags
&
OC_F_BUSY
);
oc
->
timer_when
=
EXP_When
(
&
oc
->
exp
);
exp_event
(
wrk
,
oc
,
EXP_INJECT
);
exp_mail_it
(
oc
,
OC_EF_INSERT
|
OC_EF_EXP
);
}
/*--------------------------------------------------------------------
* Insert new object.
*
...
...
@@ -203,11 +179,11 @@ EXP_Insert(struct worker *wrk, struct objcore *oc)
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
CHECK_OBJ_NOTNULL
(
oc
,
OBJCORE_MAGIC
);
HSH_Ref
(
oc
);
AZ
(
oc
->
exp_flags
&
(
OC_EF_INSERT
|
OC_EF_MOVE
));
AZ
(
oc
->
flags
&
OC_F_DYING
);
AN
(
oc
->
flags
&
OC_F_BUSY
);
HSH_Ref
(
oc
);
exp_event
(
wrk
,
oc
,
EXP_INSERT
);
exp_mail_it
(
oc
,
OC_EF_INSERT
|
OC_EF_EXP
|
OC_EF_MOVE
);
...
...
@@ -352,7 +328,7 @@ exp_expire(struct exp_priv *ep, double now)
if
(
oc
==
NULL
)
return
(
now
+
355
.
/
113
.);
VSLb
(
&
ep
->
vsl
,
SLT_ExpKill
,
"EXP_expire p=%p e=%.9f f=0x%x"
,
oc
,
oc
->
timer_when
,
oc
->
flags
);
oc
->
timer_when
-
now
,
oc
->
flags
);
CHECK_OBJ_NOTNULL
(
oc
,
OBJCORE_MAGIC
);
...
...
bin/varnishd/cache/cache_hash.c
View file @
cc5380f2
...
...
@@ -273,7 +273,6 @@ HSH_Insert(struct worker *wrk, const void *digest, struct objcore *oc)
assert
(
oh
->
refcnt
>
0
);
/* Insert (precreated) objcore in objecthead */
oc
->
refcnt
=
1
;
CHECK_OBJ_NOTNULL
(
oc
,
OBJCORE_MAGIC
);
AZ
(
oc
->
flags
&
OC_F_BUSY
);
...
...
@@ -745,6 +744,7 @@ HSH_DerefBoc(struct worker *wrk, struct objcore *oc)
boc
=
oc
->
boc
;
CHECK_OBJ_NOTNULL
(
boc
,
BOC_MAGIC
);
Lck_Lock
(
&
oc
->
objhead
->
mtx
);
assert
(
oc
->
refcnt
>
0
);
assert
(
boc
->
refcount
>
0
);
r
=
--
boc
->
refcount
;
if
(
r
==
0
)
...
...
bin/varnishd/storage/storage_persistent_silo.c
View file @
cc5380f2
...
...
@@ -165,13 +165,15 @@ smp_load_seg(struct worker *wrk, const struct smp_sc *sc,
smp_init_oc
(
oc
,
sg
,
no
);
oc
->
stobj
->
priv2
|=
NEED_FIXUP
;
oc
->
ban
=
BAN_RefBan
(
oc
,
so
->
ban
);
HSH_Insert
(
wrk
,
so
->
hash
,
oc
);
oc
->
exp
=
so
->
exp
;
sg
->
nobj
++
;
EXP_Inject
(
wrk
,
oc
);
oc
->
refcnt
++
;
HSH_Insert
(
wrk
,
so
->
hash
,
oc
);
EXP_Insert
(
wrk
,
oc
);
AN
(
isnan
(
oc
->
last_lru
));
HSH_DerefBoc
(
wrk
,
oc
);
// XXX Keep it an stream resurrection?
AZ
(
isnan
(
oc
->
last_lru
));
(
void
)
HSH_DerefObjCore
(
wrk
,
&
oc
);
}
Pool_Sumstat
(
wrk
);
sg
->
flags
|=
SMP_SEG_LOADED
;
...
...
@@ -457,17 +459,14 @@ smp_oc_sml_getobj(struct worker *wrk, struct objcore *oc)
return
(
o
);
}
static
void
static
void
__match_proto__
(
objupdatemeta_f
)
smp_oc_objupdatemeta
(
struct
worker
*
wrk
,
struct
objcore
*
oc
)
{
struct
object
*
o
;
struct
smp_seg
*
sg
;
struct
smp_object
*
so
;
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
CHECK_OBJ_NOTNULL
(
oc
,
OBJCORE_MAGIC
);
o
=
smp_oc_sml_getobj
(
wrk
,
oc
);
AN
(
o
);
CAST_OBJ_NOTNULL
(
sg
,
oc
->
stobj
->
priv
,
SMP_SEG_MAGIC
);
CHECK_OBJ_NOTNULL
(
sg
->
sc
,
SMP_SC_MAGIC
);
...
...
bin/varnishtest/tests/p00005.vtc
View file @
cc5380f2
...
...
@@ -52,6 +52,8 @@ varnish v1 -vcl+backend {
delay 5
varnish v1 -expect n_object == 0
logexpect l1 -v v1 -g vxid -q "Begin ~ bereq" {
expect * 1002 Storage "persistent s0"
} -start
...
...
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