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
85b8a22d
Commit
85b8a22d
authored
Feb 23, 2016
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tell stevedores about oc->state changes.
This allows Martin to stash attributes on going into BOS_STREAM.
parent
e964656b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
11 deletions
+22
-11
cache.h
bin/varnishd/cache/cache.h
+2
-1
cache_fetch.c
bin/varnishd/cache/cache_fetch.c
+7
-7
cache_obj.c
bin/varnishd/cache/cache_obj.c
+10
-2
cache_obj.h
bin/varnishd/cache/cache_obj.h
+3
-1
No files found.
bin/varnishd/cache/cache.h
View file @
85b8a22d
...
...
@@ -857,7 +857,8 @@ int ObjIterate(struct worker *, struct objcore *,
int
ObjGetSpace
(
struct
worker
*
,
struct
objcore
*
,
ssize_t
*
sz
,
uint8_t
**
ptr
);
void
ObjExtend
(
struct
worker
*
,
struct
objcore
*
,
ssize_t
l
);
uint64_t
ObjWaitExtend
(
struct
worker
*
,
struct
objcore
*
,
uint64_t
l
);
void
ObjSetState
(
const
struct
objcore
*
,
enum
boc_state_e
next
);
void
ObjSetState
(
struct
worker
*
,
const
struct
objcore
*
,
enum
boc_state_e
next
);
void
ObjWaitState
(
const
struct
objcore
*
,
enum
boc_state_e
want
);
void
ObjTrimStore
(
struct
worker
*
,
struct
objcore
*
);
void
ObjTouch
(
struct
worker
*
,
struct
objcore
*
,
double
now
);
...
...
bin/varnishd/cache/cache_fetch.c
View file @
85b8a22d
...
...
@@ -202,7 +202,7 @@ vbf_stp_mkbereq(const struct worker *wrk, struct busyobj *bo)
bo
->
ws_bo
=
WS_Snapshot
(
bo
->
ws
);
HTTP_Copy
(
bo
->
bereq
,
bo
->
bereq0
);
ObjSetState
(
bo
->
fetch_objcore
,
BOS_REQ_DONE
);
ObjSetState
(
bo
->
wrk
,
bo
->
fetch_objcore
,
BOS_REQ_DONE
);
return
(
F_STP_STARTFETCH
);
}
...
...
@@ -670,7 +670,7 @@ vbf_stp_fetch(struct worker *wrk, struct busyobj *bo)
if
(
bo
->
do_stream
)
{
HSH_Unbusy
(
wrk
,
bo
->
fetch_objcore
);
ObjSetState
(
bo
->
fetch_objcore
,
BOS_STREAM
);
ObjSetState
(
wrk
,
bo
->
fetch_objcore
,
BOS_STREAM
);
}
VSLb
(
bo
->
vsl
,
SLT_Fetch_Body
,
"%u %s %s"
,
...
...
@@ -704,7 +704,7 @@ vbf_stp_fetch(struct worker *wrk, struct busyobj *bo)
give predictable backend reuse behavior for varnishtest */
VDI_Finish
(
bo
->
wrk
,
bo
);
ObjSetState
(
bo
->
fetch_objcore
,
BOS_FINISHED
);
ObjSetState
(
wrk
,
bo
->
fetch_objcore
,
BOS_FINISHED
);
VSLb_ts_busyobj
(
bo
,
"BerespBody"
,
W_TIM_real
(
wrk
));
if
(
bo
->
stale_oc
!=
NULL
)
HSH_Kill
(
bo
->
stale_oc
);
...
...
@@ -758,7 +758,7 @@ vbf_stp_condfetch(struct worker *wrk, struct busyobj *bo)
if
(
bo
->
do_stream
)
{
HSH_Unbusy
(
wrk
,
bo
->
fetch_objcore
);
ObjSetState
(
bo
->
fetch_objcore
,
BOS_STREAM
);
ObjSetState
(
wrk
,
bo
->
fetch_objcore
,
BOS_STREAM
);
}
if
(
ObjIterate
(
wrk
,
bo
->
stale_oc
,
bo
,
vbf_objiterator
))
...
...
@@ -780,7 +780,7 @@ vbf_stp_condfetch(struct worker *wrk, struct busyobj *bo)
give predictable backend reuse behavior for varnishtest */
VDI_Finish
(
bo
->
wrk
,
bo
);
ObjSetState
(
bo
->
fetch_objcore
,
BOS_FINISHED
);
ObjSetState
(
wrk
,
bo
->
fetch_objcore
,
BOS_FINISHED
);
VSLb_ts_busyobj
(
bo
,
"BerespBody"
,
W_TIM_real
(
wrk
));
return
(
F_STP_DONE
);
}
...
...
@@ -881,7 +881,7 @@ vbf_stp_error(struct worker *wrk, struct busyobj *bo)
VSB_delete
(
synth_body
);
HSH_Unbusy
(
wrk
,
bo
->
fetch_objcore
);
ObjSetState
(
bo
->
fetch_objcore
,
BOS_FINISHED
);
ObjSetState
(
wrk
,
bo
->
fetch_objcore
,
BOS_FINISHED
);
return
(
F_STP_DONE
);
}
...
...
@@ -903,7 +903,7 @@ vbf_stp_fail(struct worker *wrk, const struct busyobj *bo)
HSH_Kill
(
bo
->
fetch_objcore
);
}
wrk
->
stats
->
fetch_failed
++
;
ObjSetState
(
bo
->
fetch_objcore
,
BOS_FAILED
);
ObjSetState
(
wrk
,
bo
->
fetch_objcore
,
BOS_FAILED
);
return
(
F_STP_DONE
);
}
...
...
bin/varnishd/cache/cache_obj.c
View file @
85b8a22d
...
...
@@ -220,13 +220,21 @@ ObjWaitExtend(struct worker *wrk, struct objcore *oc, uint64_t l)
*/
void
ObjSetState
(
const
struct
objcore
*
oc
,
enum
boc_state_e
next
)
ObjSetState
(
struct
worker
*
wrk
,
const
struct
objcore
*
oc
,
enum
boc_state_e
next
)
{
const
struct
obj_methods
*
om
;
CHECK_OBJ_NOTNULL
(
oc
,
OBJCORE_MAGIC
);
CHECK_OBJ_NOTNULL
(
oc
->
boc
,
BOC_MAGIC
);
assert
(
next
>
oc
->
boc
->
state
);
CHECK_OBJ_ORNULL
(
oc
->
stobj
->
stevedore
,
STEVEDORE_MAGIC
);
if
(
oc
->
stobj
->
stevedore
!=
NULL
)
{
om
=
oc
->
stobj
->
stevedore
->
methods
;
if
(
om
->
objsetstate
!=
NULL
)
om
->
objsetstate
(
wrk
,
oc
,
next
);
}
Lck_Lock
(
&
oc
->
boc
->
mtx
);
oc
->
boc
->
state
=
next
;
AZ
(
pthread_cond_broadcast
(
&
oc
->
boc
->
cond
));
...
...
bin/varnishd/cache/cache_obj.h
View file @
85b8a22d
...
...
@@ -32,7 +32,8 @@
typedef
void
objfree_f
(
struct
worker
*
,
struct
objcore
*
);
/* This method is only used by SML (...to get to persistent) */
typedef
void
objsetstate_f
(
struct
worker
*
,
const
struct
objcore
*
,
enum
boc_state_e
);
typedef
int
objiterator_f
(
struct
worker
*
,
struct
objcore
*
,
void
*
priv
,
objiterate_f
*
func
);
...
...
@@ -59,5 +60,6 @@ struct obj_methods {
objgetattr_f
*
objgetattr
;
objsetattr_f
*
objsetattr
;
objtouch_f
*
objtouch
;
objsetstate_f
*
objsetstate
;
};
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