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
87755214
Commit
87755214
authored
Dec 15, 2015
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change allocobj related prototypes
parent
616c1ee5
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
21 additions
and
16 deletions
+21
-16
cache.h
bin/varnishd/cache/cache.h
+1
-1
cache_fetch.c
bin/varnishd/cache/cache_fetch.c
+2
-2
cache_req_body.c
bin/varnishd/cache/cache_req_body.c
+1
-1
cache_req_fsm.c
bin/varnishd/cache/cache_req_fsm.c
+1
-1
stevedore.c
bin/varnishd/storage/stevedore.c
+4
-4
storage.h
bin/varnishd/storage/storage.h
+2
-2
storage_persistent.c
bin/varnishd/storage/storage_persistent.c
+5
-2
storage_simple.c
bin/varnishd/storage/storage_simple.c
+5
-3
No files found.
bin/varnishd/cache/cache.h
View file @
87755214
...
...
@@ -1040,7 +1040,7 @@ void RFC2616_Weaken_Etag(struct http *hp);
void
RFC2616_Vary_AE
(
struct
http
*
hp
);
/* stevedore.c */
int
STV_NewObject
(
struct
objcore
*
,
struct
worker
*
,
int
STV_NewObject
(
struct
worker
*
,
struct
objcore
*
,
const
char
*
hint
,
unsigned
len
);
struct
storage
*
STV_alloc
(
const
struct
stevedore
*
,
size_t
size
);
void
STV_trim
(
const
struct
stevedore
*
,
struct
storage
*
,
size_t
size
,
...
...
bin/varnishd/cache/cache_fetch.c
View file @
87755214
...
...
@@ -62,7 +62,7 @@ vbf_allocobj(struct busyobj *bo, unsigned l)
bo
->
storage_hint
=
NULL
;
if
(
STV_NewObject
(
bo
->
fetch_objcore
,
bo
->
wrk
,
storage_hint
,
l
))
if
(
STV_NewObject
(
bo
->
wrk
,
bo
->
fetch_objcore
,
storage_hint
,
l
))
return
(
1
);
if
(
storage_hint
!=
NULL
&&
!
strcmp
(
storage_hint
,
TRANSIENT_STORAGE
))
...
...
@@ -77,7 +77,7 @@ vbf_allocobj(struct busyobj *bo, unsigned l)
oc
->
exp
.
ttl
=
cache_param
->
shortlived
;
oc
->
exp
.
grace
=
0
.
0
;
oc
->
exp
.
keep
=
0
.
0
;
return
(
STV_NewObject
(
bo
->
fetch_objcore
,
bo
->
wrk
,
return
(
STV_NewObject
(
bo
->
wrk
,
bo
->
fetch_objcore
,
TRANSIENT_STORAGE
,
l
));
}
...
...
bin/varnishd/cache/cache_req_body.c
View file @
87755214
...
...
@@ -218,7 +218,7 @@ VRB_Cache(struct req *req, ssize_t maxsize)
req
->
body_oc
=
HSH_Private
(
req
->
wrk
);
AN
(
req
->
body_oc
);
XXXAN
(
STV_NewObject
(
req
->
body_oc
,
req
->
wrk
,
TRANSIENT_STORAGE
,
8
));
XXXAN
(
STV_NewObject
(
req
->
wrk
,
req
->
body_oc
,
TRANSIENT_STORAGE
,
8
));
vfc
->
http
=
req
->
http
;
vfc
->
oc
=
req
->
body_oc
;
...
...
bin/varnishd/cache/cache_req_fsm.c
View file @
87755214
...
...
@@ -287,7 +287,7 @@ cnt_synth(struct worker *wrk, struct req *req)
req
->
objcore
=
HSH_Private
(
wrk
);
CHECK_OBJ_NOTNULL
(
req
->
objcore
,
OBJCORE_MAGIC
);
if
(
STV_NewObject
(
req
->
objcore
,
wrk
,
TRANSIENT_STORAGE
,
1024
))
{
if
(
STV_NewObject
(
wrk
,
req
->
objcore
,
TRANSIENT_STORAGE
,
1024
))
{
szl
=
VSB_len
(
synth_body
);
assert
(
szl
>=
0
);
}
else
...
...
bin/varnishd/storage/stevedore.c
View file @
87755214
...
...
@@ -138,7 +138,7 @@ STV_alloc(const struct stevedore *stv, size_t size)
*/
int
STV_NewObject
(
struct
objcore
*
oc
,
struct
worker
*
wrk
,
STV_NewObject
(
struct
worker
*
wrk
,
struct
objcore
*
oc
,
const
char
*
hint
,
unsigned
wsl
)
{
struct
stevedore
*
stv
,
*
stv0
;
...
...
@@ -150,12 +150,12 @@ STV_NewObject(struct objcore *oc, struct worker *wrk,
stv
=
stv0
=
stv_pick_stevedore
(
wrk
->
vsl
,
&
hint
);
AN
(
stv
->
allocobj
);
j
=
stv
->
allocobj
(
stv
,
oc
,
wsl
);
j
=
stv
->
allocobj
(
wrk
,
stv
,
oc
,
wsl
,
0
);
if
(
j
==
0
&&
hint
==
NULL
)
{
do
{
stv
=
stv_pick_stevedore
(
wrk
->
vsl
,
&
hint
);
AN
(
stv
->
allocobj
);
j
=
stv
->
allocobj
(
stv
,
oc
,
wsl
);
j
=
stv
->
allocobj
(
wrk
,
stv
,
oc
,
wsl
,
0
);
}
while
(
j
==
0
&&
stv
!=
stv0
);
}
if
(
j
==
0
)
{
...
...
@@ -163,7 +163,7 @@ STV_NewObject(struct objcore *oc, struct worker *wrk,
for
(
i
=
0
;
j
==
0
&&
i
<
cache_param
->
nuke_limit
;
i
++
)
{
if
(
EXP_NukeOne
(
wrk
,
stv
->
lru
)
==
-
1
)
break
;
j
=
stv
->
allocobj
(
stv
,
oc
,
wsl
);
j
=
stv
->
allocobj
(
wrk
,
stv
,
oc
,
wsl
,
0
);
}
}
...
...
bin/varnishd/storage/storage.h
View file @
87755214
...
...
@@ -63,8 +63,8 @@ typedef void storage_open_f(const struct stevedore *);
typedef
struct
storage
*
storage_alloc_f
(
const
struct
stevedore
*
,
size_t
size
);
typedef
void
storage_trim_f
(
struct
storage
*
,
size_t
size
,
int
move_ok
);
typedef
void
storage_free_f
(
struct
storage
*
);
typedef
int
storage_allocobj_f
(
const
struct
stevedore
*
,
struct
objc
ore
*
,
unsigned
ltot
);
typedef
int
storage_allocobj_f
(
struct
worker
*
,
const
struct
steved
ore
*
,
struct
objcore
*
,
unsigned
ltot
,
int
really
);
typedef
void
storage_close_f
(
const
struct
stevedore
*
);
typedef
void
storage_signal_close_f
(
const
struct
stevedore
*
);
typedef
int
storage_baninfo_f
(
const
struct
stevedore
*
,
enum
baninfo
event
,
...
...
bin/varnishd/storage/storage_persistent.c
View file @
87755214
...
...
@@ -503,8 +503,9 @@ smp_allocx(const struct stevedore *st, size_t min_size, size_t max_size,
* Allocate an object
*/
static
int
smp_allocobj
(
const
struct
stevedore
*
stv
,
struct
objcore
*
oc
,
unsigned
wsl
)
static
int
__match_proto__
(
storage_allocobj_f
)
smp_allocobj
(
struct
worker
*
wrk
,
const
struct
stevedore
*
stv
,
struct
objcore
*
oc
,
unsigned
wsl
,
int
really
)
{
struct
object
*
o
;
struct
storage
*
st
;
...
...
@@ -514,7 +515,9 @@ smp_allocobj(const struct stevedore *stv, struct objcore *oc, unsigned wsl)
unsigned
objidx
;
unsigned
ltot
;
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
CHECK_OBJ_NOTNULL
(
oc
,
OBJCORE_MAGIC
);
(
void
)
really
;
CAST_OBJ_NOTNULL
(
sc
,
stv
->
priv
,
SMP_SC_MAGIC
);
/* Don't entertain already dead objects */
...
...
bin/varnishd/storage/storage_simple.c
View file @
87755214
...
...
@@ -74,15 +74,17 @@ SML_MkObject(const struct stevedore *stv, struct objcore *oc, void *ptr)
* implement persistent storage can rely on.
*/
int
SML_allocobj
(
const
struct
stevedore
*
stv
,
struct
objcore
*
oc
,
unsigned
wsl
)
int
__match_proto__
(
storage_allocobj_f
)
SML_allocobj
(
struct
worker
*
wrk
,
const
struct
stevedore
*
stv
,
struct
objcore
*
oc
,
unsigned
wsl
,
int
really
)
{
struct
object
*
o
;
struct
storage
*
st
;
unsigned
ltot
;
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
CHECK_OBJ_NOTNULL
(
oc
,
OBJCORE_MAGIC
);
(
void
)
really
;
ltot
=
sizeof
(
struct
object
)
+
PRNDUP
(
wsl
);
st
=
stv
->
alloc
(
stv
,
ltot
);
if
(
st
==
NULL
)
...
...
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