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
245ea1da
Commit
245ea1da
authored
Sep 15, 2014
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Push busyobj out of STV_NewObject()
parent
baf85418
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
12 deletions
+15
-12
cache.h
bin/varnishd/cache/cache.h
+2
-1
cache_fetch.c
bin/varnishd/cache/cache_fetch.c
+4
-2
stevedore.c
bin/varnishd/storage/stevedore.c
+9
-9
No files found.
bin/varnishd/cache/cache.h
View file @
245ea1da
...
...
@@ -1216,7 +1216,8 @@ void RFC2616_Weaken_Etag(struct http *hp);
void
RFC2616_Vary_AE
(
struct
http
*
hp
);
/* stevedore.c */
int
STV_NewObject
(
struct
busyobj
*
,
const
char
*
hint
,
unsigned
len
);
int
STV_NewObject
(
struct
objcore
*
,
struct
vsl_log
*
,
struct
dstat
*
,
const
char
*
hint
,
unsigned
len
);
struct
storage
*
STV_alloc
(
struct
stevedore
*
,
size_t
size
);
void
STV_trim
(
struct
storage
*
st
,
size_t
size
,
int
move_ok
);
void
STV_free
(
struct
storage
*
st
);
...
...
bin/varnishd/cache/cache_fetch.c
View file @
245ea1da
...
...
@@ -66,7 +66,8 @@ vbf_allocobj(struct busyobj *bo, unsigned l)
bo
->
storage_hint
=
NULL
;
if
(
STV_NewObject
(
bo
,
storage_hint
,
l
))
if
(
STV_NewObject
(
bo
->
fetch_objcore
,
bo
->
vsl
,
bo
->
stats
,
storage_hint
,
l
))
return
(
1
);
if
(
storage_hint
!=
NULL
&&
!
strcmp
(
storage_hint
,
TRANSIENT_STORAGE
))
...
...
@@ -81,7 +82,8 @@ 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
,
TRANSIENT_STORAGE
,
l
));
return
(
STV_NewObject
(
bo
->
fetch_objcore
,
bo
->
vsl
,
bo
->
stats
,
TRANSIENT_STORAGE
,
l
));
}
/*--------------------------------------------------------------------
...
...
bin/varnishd/storage/stevedore.c
View file @
245ea1da
...
...
@@ -246,27 +246,27 @@ stv_default_allocobj(struct stevedore *stv, struct objcore *oc, unsigned ltot)
*/
int
STV_NewObject
(
struct
busyobj
*
bo
,
const
char
*
hint
,
unsigned
wsl
)
STV_NewObject
(
struct
objcore
*
oc
,
struct
vsl_log
*
vsl
,
struct
dstat
*
stats
,
const
char
*
hint
,
unsigned
wsl
)
{
struct
objcore
*
oc
;
struct
stevedore
*
stv
,
*
stv0
;
unsigned
ltot
;
int
i
,
j
;
CHECK_OBJ_NOTNULL
(
bo
,
BUSYOBJ_MAGIC
);
oc
=
bo
->
fetch_objcore
;
CHECK_OBJ_NOTNULL
(
oc
,
OBJCORE_MAGIC
);
AN
(
vsl
);
AN
(
stats
);
assert
(
wsl
>
0
);
wsl
=
PRNDUP
(
wsl
);
ltot
=
sizeof
(
struct
object
)
+
wsl
;
stv
=
stv0
=
stv_pick_stevedore
(
bo
->
vsl
,
&
hint
);
stv
=
stv0
=
stv_pick_stevedore
(
vsl
,
&
hint
);
AN
(
stv
->
allocobj
);
j
=
stv
->
allocobj
(
stv
,
oc
,
ltot
);
if
(
j
==
0
&&
hint
==
NULL
)
{
do
{
stv
=
stv_pick_stevedore
(
bo
->
vsl
,
&
hint
);
stv
=
stv_pick_stevedore
(
vsl
,
&
hint
);
AN
(
stv
->
allocobj
);
j
=
stv
->
allocobj
(
stv
,
oc
,
ltot
);
}
while
(
j
==
0
&&
stv
!=
stv0
);
...
...
@@ -274,7 +274,7 @@ STV_NewObject(struct busyobj *bo, const char *hint, unsigned wsl)
if
(
j
==
0
)
{
/* no luck; try to free some space and keep trying */
for
(
i
=
0
;
j
==
0
&&
i
<
cache_param
->
nuke_limit
;
i
++
)
{
if
(
EXP_NukeOne
(
bo
->
vsl
,
bo
->
stats
,
stv
->
lru
)
==
-
1
)
if
(
EXP_NukeOne
(
vsl
,
stats
,
stv
->
lru
)
==
-
1
)
break
;
j
=
stv
->
allocobj
(
stv
,
oc
,
ltot
);
}
...
...
@@ -283,8 +283,8 @@ STV_NewObject(struct busyobj *bo, const char *hint, unsigned wsl)
if
(
j
==
0
)
return
(
0
);
bo
->
stats
->
n_object
++
;
VSLb
(
bo
->
vsl
,
SLT_Storage
,
"%s %s"
,
stats
->
n_object
++
;
VSLb
(
vsl
,
SLT_Storage
,
"%s %s"
,
oc
->
stobj
->
stevedore
->
name
,
oc
->
stobj
->
stevedore
->
ident
);
return
(
1
);
}
...
...
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