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
de6e9b67
Commit
de6e9b67
authored
Jan 19, 2016
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce strength arguments from busyobj to boc
parent
9f8dba34
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
49 additions
and
45 deletions
+49
-45
cache.h
bin/varnishd/cache/cache.h
+4
-5
cache_busyobj.c
bin/varnishd/cache/cache_busyobj.c
+31
-26
cache_esi_deliver.c
bin/varnishd/cache/cache_esi_deliver.c
+1
-1
cache_fetch.c
bin/varnishd/cache/cache_fetch.c
+9
-9
cache_fetch_proc.c
bin/varnishd/cache/cache_fetch_proc.c
+1
-1
cache_req_fsm.c
bin/varnishd/cache/cache_req_fsm.c
+2
-2
storage_simple.c
bin/varnishd/storage/storage_simple.c
+1
-1
No files found.
bin/varnishd/cache/cache.h
View file @
de6e9b67
...
...
@@ -680,11 +680,10 @@ double BAN_Time(const struct ban *ban);
/* cache_busyobj.c */
struct
busyobj
*
VBO_GetBusyObj
(
struct
worker
*
,
const
struct
req
*
);
void
VBO_DerefBusyObj
(
struct
worker
*
wrk
,
struct
busyobj
**
busyobj
);
void
VBO_extend
(
struct
worker
*
,
struct
objcore
*
,
struct
busyobj
*
,
ssize_t
);
ssize_t
VBO_waitlen
(
struct
worker
*
,
struct
objcore
*
,
struct
busyobj
*
,
ssize_t
l
);
void
VBO_setstate
(
struct
busyobj
*
bo
,
enum
busyobj_state_e
next
);
void
VBO_waitstate
(
struct
busyobj
*
bo
,
enum
busyobj_state_e
want
);
void
VBO_extend
(
struct
worker
*
,
struct
objcore
*
,
struct
boc
*
,
ssize_t
);
ssize_t
VBO_waitlen
(
struct
worker
*
,
struct
objcore
*
,
struct
boc
*
,
ssize_t
l
);
void
VBO_setstate
(
struct
boc
*
,
enum
busyobj_state_e
next
);
void
VBO_waitstate
(
struct
boc
*
,
enum
busyobj_state_e
want
);
/* cache_cli.c [CLI] */
extern
pthread_t
cli_thread
;
...
...
bin/varnishd/cache/cache_busyobj.c
View file @
de6e9b67
...
...
@@ -227,64 +227,69 @@ VBO_DerefBusyObj(struct worker *wrk, struct busyobj **pbo)
}
void
VBO_extend
(
struct
worker
*
wrk
,
struct
objcore
*
oc
,
struct
b
usyobj
*
bo
,
VBO_extend
(
struct
worker
*
wrk
,
struct
objcore
*
oc
,
struct
b
oc
*
boc
,
ssize_t
l
)
{
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
CHECK_OBJ_NOTNULL
(
oc
,
OBJCORE_MAGIC
);
CHECK_OBJ_NOTNULL
(
bo
,
BUSYOBJ
_MAGIC
);
CHECK_OBJ_NOTNULL
(
bo
c
,
BOC
_MAGIC
);
if
(
l
==
0
)
return
;
assert
(
l
>
0
);
Lck_Lock
(
&
bo
->
bo
c
->
mtx
);
Lck_Lock
(
&
boc
->
mtx
);
ObjExtend
(
wrk
,
oc
,
l
);
AZ
(
pthread_cond_broadcast
(
&
bo
->
bo
c
->
cond
));
Lck_Unlock
(
&
bo
->
bo
c
->
mtx
);
AZ
(
pthread_cond_broadcast
(
&
boc
->
cond
));
Lck_Unlock
(
&
boc
->
mtx
);
}
ssize_t
VBO_waitlen
(
struct
worker
*
wrk
,
struct
objcore
*
oc
,
struct
b
usyobj
*
bo
,
VBO_waitlen
(
struct
worker
*
wrk
,
struct
objcore
*
oc
,
struct
b
oc
*
boc
,
ssize_t
l
)
{
ssize_t
rv
;
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
CHECK_OBJ_NOTNULL
(
bo
,
BUSYOBJ
_MAGIC
);
xxxassert
(
bo
->
fetch_objcore
==
oc
);
Lck_Lock
(
&
bo
->
bo
c
->
mtx
);
CHECK_OBJ_NOTNULL
(
oc
,
OBJCORE
_MAGIC
);
CHECK_OBJ_NOTNULL
(
boc
,
BOC_MAGIC
);
Lck_Lock
(
&
boc
->
mtx
);
rv
=
ObjGetLen
(
wrk
,
oc
);
while
(
1
)
{
assert
(
l
<=
rv
||
bo
->
bo
c
->
state
==
BOS_FAILED
);
if
(
rv
>
l
||
bo
->
bo
c
->
state
>=
BOS_FINISHED
)
assert
(
l
<=
rv
||
boc
->
state
==
BOS_FAILED
);
if
(
rv
>
l
||
boc
->
state
>=
BOS_FINISHED
)
break
;
(
void
)
Lck_CondWait
(
&
bo
->
boc
->
cond
,
&
bo
->
boc
->
mtx
,
0
);
(
void
)
Lck_CondWait
(
&
bo
c
->
cond
,
&
boc
->
mtx
,
0
);
rv
=
ObjGetLen
(
wrk
,
oc
);
}
Lck_Unlock
(
&
bo
->
bo
c
->
mtx
);
Lck_Unlock
(
&
boc
->
mtx
);
return
(
rv
);
}
void
VBO_setstate
(
struct
b
usyobj
*
bo
,
enum
busyobj_state_e
next
)
VBO_setstate
(
struct
b
oc
*
boc
,
enum
busyobj_state_e
next
)
{
CHECK_OBJ_NOTNULL
(
bo
,
BUSYOBJ_MAGIC
);
assert
(
bo
->
do_stream
||
next
!=
BOS_STREAM
);
assert
(
next
>
bo
->
boc
->
state
);
Lck_Lock
(
&
bo
->
boc
->
mtx
);
bo
->
boc
->
state
=
next
;
AZ
(
pthread_cond_broadcast
(
&
bo
->
boc
->
cond
));
Lck_Unlock
(
&
bo
->
boc
->
mtx
);
CHECK_OBJ_NOTNULL
(
boc
,
BOC_MAGIC
);
// assert(bo->do_stream || next != BOS_STREAM);
assert
(
next
>
boc
->
state
);
Lck_Lock
(
&
boc
->
mtx
);
boc
->
state
=
next
;
AZ
(
pthread_cond_broadcast
(
&
boc
->
cond
));
Lck_Unlock
(
&
boc
->
mtx
);
}
void
VBO_waitstate
(
struct
b
usyobj
*
bo
,
enum
busyobj_state_e
want
)
VBO_waitstate
(
struct
b
oc
*
boc
,
enum
busyobj_state_e
want
)
{
Lck_Lock
(
&
bo
->
boc
->
mtx
);
CHECK_OBJ_NOTNULL
(
boc
,
BOC_MAGIC
);
Lck_Lock
(
&
boc
->
mtx
);
while
(
1
)
{
if
(
bo
->
bo
c
->
state
>=
want
)
if
(
boc
->
state
>=
want
)
break
;
(
void
)
Lck_CondWait
(
&
bo
->
boc
->
cond
,
&
bo
->
boc
->
mtx
,
0
);
(
void
)
Lck_CondWait
(
&
bo
c
->
cond
,
&
boc
->
mtx
,
0
);
}
Lck_Unlock
(
&
bo
->
bo
c
->
mtx
);
Lck_Unlock
(
&
boc
->
mtx
);
}
bin/varnishd/cache/cache_esi_deliver.c
View file @
de6e9b67
...
...
@@ -689,7 +689,7 @@ ved_stripgzip(struct req *req, struct busyobj *bo)
/* XXX: Is this really required ? */
if
(
bo
!=
NULL
)
VBO_waitstate
(
bo
,
BOS_FINISHED
);
VBO_waitstate
(
bo
->
boc
,
BOS_FINISHED
);
AN
(
ObjCheckFlag
(
req
->
wrk
,
req
->
objcore
,
OF_GZIPED
));
...
...
bin/varnishd/cache/cache_fetch.c
View file @
de6e9b67
...
...
@@ -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
);
VBO_setstate
(
bo
,
BOS_REQ_DONE
);
VBO_setstate
(
bo
->
boc
,
BOS_REQ_DONE
);
return
(
F_STP_STARTFETCH
);
}
...
...
@@ -648,7 +648,7 @@ vbf_stp_fetch(struct worker *wrk, struct busyobj *bo)
if
(
bo
->
do_stream
)
{
HSH_Unbusy
(
wrk
,
bo
->
fetch_objcore
);
VBO_setstate
(
bo
,
BOS_STREAM
);
VBO_setstate
(
bo
->
boc
,
BOS_STREAM
);
}
VSLb
(
bo
->
vsl
,
SLT_Fetch_Body
,
"%u %s %s"
,
...
...
@@ -682,7 +682,7 @@ vbf_stp_fetch(struct worker *wrk, struct busyobj *bo)
give predictable backend reuse behavior for varnishtest */
VDI_Finish
(
bo
->
wrk
,
bo
);
VBO_setstate
(
bo
,
BOS_FINISHED
);
VBO_setstate
(
bo
->
boc
,
BOS_FINISHED
);
VSLb_ts_busyobj
(
bo
,
"BerespBody"
,
W_TIM_real
(
wrk
));
if
(
bo
->
stale_oc
!=
NULL
)
EXP_Rearm
(
bo
->
stale_oc
,
bo
->
stale_oc
->
exp
.
t_origin
,
0
,
0
,
0
);
...
...
@@ -736,7 +736,7 @@ vbf_stp_condfetch(struct worker *wrk, struct busyobj *bo)
if
(
bo
->
do_stream
)
{
HSH_Unbusy
(
wrk
,
bo
->
fetch_objcore
);
VBO_setstate
(
bo
,
BOS_STREAM
);
VBO_setstate
(
bo
->
boc
,
BOS_STREAM
);
}
if
(
ObjIterate
(
wrk
,
bo
->
stale_oc
,
bo
,
vbf_objiterator
))
...
...
@@ -758,7 +758,7 @@ vbf_stp_condfetch(struct worker *wrk, struct busyobj *bo)
give predictable backend reuse behavior for varnishtest */
VDI_Finish
(
bo
->
wrk
,
bo
);
VBO_setstate
(
bo
,
BOS_FINISHED
);
VBO_setstate
(
bo
->
boc
,
BOS_FINISHED
);
VSLb_ts_busyobj
(
bo
,
"BerespBody"
,
W_TIM_real
(
wrk
));
return
(
F_STP_DONE
);
}
...
...
@@ -858,7 +858,7 @@ vbf_stp_error(struct worker *wrk, struct busyobj *bo)
VSB_delete
(
synth_body
);
HSH_Unbusy
(
wrk
,
bo
->
fetch_objcore
);
VBO_setstate
(
bo
,
BOS_FINISHED
);
VBO_setstate
(
bo
->
boc
,
BOS_FINISHED
);
return
(
F_STP_DONE
);
}
...
...
@@ -881,7 +881,7 @@ vbf_stp_fail(struct worker *wrk, struct busyobj *bo)
bo
->
fetch_objcore
->
exp
.
t_origin
,
0
,
0
,
0
);
}
wrk
->
stats
->
fetch_failed
++
;
VBO_setstate
(
bo
,
BOS_FAILED
);
VBO_setstate
(
bo
->
boc
,
BOS_FAILED
);
return
(
F_STP_DONE
);
}
...
...
@@ -1031,9 +1031,9 @@ VBF_Fetch(struct worker *wrk, struct req *req, struct objcore *oc,
}
else
{
bo_fetch
=
NULL
;
/* ref transferred to fetch thread */
if
(
mode
==
VBF_BACKGROUND
)
{
VBO_waitstate
(
bo
,
BOS_REQ_DONE
);
VBO_waitstate
(
bo
->
boc
,
BOS_REQ_DONE
);
}
else
{
VBO_waitstate
(
bo
,
BOS_STREAM
);
VBO_waitstate
(
bo
->
boc
,
BOS_STREAM
);
if
(
bo
->
boc
->
state
==
BOS_FAILED
)
{
AN
((
oc
->
flags
&
OC_F_FAILED
));
}
else
{
...
...
bin/varnishd/cache/cache_fetch_proc.c
View file @
de6e9b67
...
...
@@ -98,7 +98,7 @@ VFP_Extend(const struct vfp_ctx *vc, ssize_t sz)
{
CHECK_OBJ_NOTNULL
(
vc
,
VFP_CTX_MAGIC
);
VBO_extend
(
vc
->
wrk
,
vc
->
oc
,
vc
->
bo
,
sz
);
VBO_extend
(
vc
->
wrk
,
vc
->
oc
,
vc
->
bo
->
boc
,
sz
);
}
/**********************************************************************
...
...
bin/varnishd/cache/cache_req_fsm.c
View file @
de6e9b67
...
...
@@ -202,7 +202,7 @@ cnt_deliver(struct worker *wrk, struct req *req)
if
(
req
->
esi_level
==
0
&&
bo
->
boc
->
state
==
BOS_FINISHED
)
{
VBO_DerefBusyObj
(
wrk
,
&
bo
);
}
else
if
(
!
bo
->
do_stream
)
{
VBO_waitstate
(
bo
,
BOS_FINISHED
);
VBO_waitstate
(
bo
->
boc
,
BOS_FINISHED
);
VBO_DerefBusyObj
(
wrk
,
&
bo
);
}
}
...
...
@@ -216,7 +216,7 @@ cnt_deliver(struct worker *wrk, struct req *req)
if
(
req
->
objcore
->
flags
&
(
OC_F_PRIVATE
|
OC_F_PASS
))
{
if
(
bo
!=
NULL
)
VBO_waitstate
(
bo
,
BOS_FINISHED
);
VBO_waitstate
(
bo
->
boc
,
BOS_FINISHED
);
ObjSlim
(
wrk
,
req
->
objcore
);
}
...
...
bin/varnishd/storage/storage_simple.c
View file @
de6e9b67
...
...
@@ -257,7 +257,7 @@ sml_iterator(struct worker *wrk, struct objcore *oc,
while
(
1
)
{
ol
=
len
;
nl
=
VBO_waitlen
(
wrk
,
oc
,
bo
,
ol
);
nl
=
VBO_waitlen
(
wrk
,
oc
,
bo
->
boc
,
ol
);
if
(
bo
->
boc
->
state
==
BOS_FAILED
)
{
ret
=
-
1
;
break
;
...
...
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