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
9bdc3e0b
Commit
9bdc3e0b
authored
Nov 11, 2014
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eliminate the per-struct-storage stevedore pointer
parent
2f407d89
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
22 additions
and
22 deletions
+22
-22
cache.h
bin/varnishd/cache/cache.h
+3
-2
cache_obj.c
bin/varnishd/cache/cache_obj.c
+7
-4
stevedore.c
bin/varnishd/storage/stevedore.c
+12
-12
storage.h
bin/varnishd/storage/storage.h
+0
-1
storage_file.c
bin/varnishd/storage/storage_file.c
+0
-1
storage_malloc.c
bin/varnishd/storage/storage_malloc.c
+0
-1
storage_persistent.c
bin/varnishd/storage/storage_persistent.c
+0
-1
No files found.
bin/varnishd/cache/cache.h
View file @
9bdc3e0b
...
...
@@ -1093,8 +1093,9 @@ void RFC2616_Vary_AE(struct http *hp);
int
STV_NewObject
(
struct
objcore
*
,
struct
worker
*
,
const
char
*
hint
,
unsigned
len
);
struct
storage
*
STV_alloc
(
const
struct
stevedore
*
,
size_t
size
);
void
STV_trim
(
struct
storage
*
st
,
size_t
size
,
int
move_ok
);
void
STV_free
(
struct
storage
*
st
);
void
STV_trim
(
const
struct
stevedore
*
,
struct
storage
*
,
size_t
size
,
int
move_ok
);
void
STV_free
(
const
struct
stevedore
*
,
struct
storage
*
st
);
void
STV_open
(
void
);
void
STV_close
(
void
);
int
STV_BanInfo
(
enum
baninfo
event
,
const
uint8_t
*
ban
,
unsigned
len
);
...
...
bin/varnishd/cache/cache_obj.c
View file @
9bdc3e0b
...
...
@@ -377,9 +377,9 @@ ObjTrimStore(struct worker *wrk, struct objcore *oc)
return
;
if
(
st
->
len
==
0
)
{
VTAILQ_REMOVE
(
&
o
->
list
,
st
,
list
);
STV_free
(
st
);
STV_free
(
st
v
,
st
);
}
else
if
(
st
->
len
<
st
->
space
)
{
STV_trim
(
st
,
st
->
len
,
1
);
STV_trim
(
st
v
,
st
,
st
->
len
,
1
);
}
}
...
...
@@ -393,6 +393,7 @@ ObjTrimStore(struct worker *wrk, struct objcore *oc)
void
ObjSlim
(
struct
worker
*
wrk
,
struct
objcore
*
oc
)
{
const
struct
stevedore
*
stv
;
struct
object
*
o
;
struct
storage
*
st
,
*
stn
;
const
struct
storeobj_methods
*
om
=
obj_getmethods
(
oc
);
...
...
@@ -404,17 +405,19 @@ ObjSlim(struct worker *wrk, struct objcore *oc)
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
CHECK_OBJ_NOTNULL
(
oc
,
OBJCORE_MAGIC
);
stv
=
oc
->
stobj
->
stevedore
;
CHECK_OBJ_NOTNULL
(
stv
,
STEVEDORE_MAGIC
);
o
=
obj_getobj
(
wrk
,
oc
);
CHECK_OBJ_NOTNULL
(
o
,
OBJECT_MAGIC
);
if
(
o
->
esidata
!=
NULL
)
{
STV_free
(
o
->
esidata
);
STV_free
(
stv
,
o
->
esidata
);
o
->
esidata
=
NULL
;
}
VTAILQ_FOREACH_SAFE
(
st
,
&
o
->
list
,
list
,
stn
)
{
CHECK_OBJ_NOTNULL
(
st
,
STORAGE_MAGIC
);
VTAILQ_REMOVE
(
&
o
->
list
,
st
,
list
);
STV_free
(
st
);
STV_free
(
st
v
,
st
);
}
}
...
...
bin/varnishd/storage/stevedore.c
View file @
9bdc3e0b
...
...
@@ -70,11 +70,11 @@ default_oc_freeobj(struct worker *wrk, struct objcore *oc)
CHECK_OBJ_NOTNULL
(
oc
,
OBJCORE_MAGIC
);
ObjSlim
(
wrk
,
oc
);
CAST_OBJ_NOTNULL
(
o
,
oc
->
stobj
->
priv
,
OBJECT_MAGIC
);
oc
->
stobj
->
priv
=
NULL
;
oc
->
stobj
->
stevedore
=
NULL
;
o
->
magic
=
0
;
STV_free
(
o
->
objstore
);
STV_free
(
oc
->
stobj
->
stevedore
,
o
->
objstore
);
memset
(
oc
->
stobj
,
0
,
sizeof
oc
->
stobj
);
wrk
->
stats
->
n_object
--
;
}
...
...
@@ -291,23 +291,23 @@ STV_NewObject(struct objcore *oc, struct worker *wrk,
/*-------------------------------------------------------------------*/
void
STV_trim
(
struct
storage
*
st
,
size_t
size
,
int
move_ok
)
STV_trim
(
const
struct
stevedore
*
stv
,
struct
storage
*
st
,
size_t
size
,
int
move_ok
)
{
CHECK_OBJ_NOTNULL
(
stv
,
STEVEDORE_MAGIC
);
CHECK_OBJ_NOTNULL
(
st
,
STORAGE_MAGIC
);
AN
(
st
->
stevedore
);
if
(
st
->
stevedore
->
trim
)
st
->
stevedore
->
trim
(
st
,
size
,
move_ok
);
}
if
(
stv
->
trim
)
stv
->
trim
(
st
,
size
,
move_ok
);
}
void
STV_free
(
struct
storage
*
st
)
STV_free
(
const
struct
stevedore
*
stv
,
struct
storage
*
st
)
{
CHECK_OBJ_NOTNULL
(
stv
,
STEVEDORE_MAGIC
);
CHECK_OBJ_NOTNULL
(
st
,
STORAGE_MAGIC
);
AN
(
st
->
stevedore
);
AN
(
st
->
stevedore
->
free
);
st
->
stevedore
->
free
(
st
);
AN
(
stv
->
free
);
stv
->
free
(
st
);
}
void
...
...
bin/varnishd/storage/storage.h
View file @
9bdc3e0b
...
...
@@ -48,7 +48,6 @@ struct storage {
VTAILQ_ENTRY
(
storage
)
list
;
const
struct
stevedore
*
stevedore
;
void
*
priv
;
unsigned
char
*
ptr
;
...
...
bin/varnishd/storage/storage_file.c
View file @
9bdc3e0b
...
...
@@ -468,7 +468,6 @@ smf_alloc(const struct stevedore *st, size_t size)
smf
->
s
.
priv
=
smf
;
smf
->
s
.
ptr
=
smf
->
ptr
;
smf
->
s
.
len
=
0
;
smf
->
s
.
stevedore
=
st
;
return
(
&
smf
->
s
);
}
...
...
bin/varnishd/storage/storage_malloc.c
View file @
9bdc3e0b
...
...
@@ -117,7 +117,6 @@ sma_alloc(const struct stevedore *st, size_t size)
sma
->
s
.
priv
=
sma
;
sma
->
s
.
len
=
0
;
sma
->
s
.
space
=
size
;
sma
->
s
.
stevedore
=
st
;
sma
->
s
.
magic
=
STORAGE_MAGIC
;
return
(
&
sma
->
s
);
}
...
...
bin/varnishd/storage/storage_persistent.c
View file @
9bdc3e0b
...
...
@@ -493,7 +493,6 @@ smp_allocx(const struct stevedore *st, size_t min_size, size_t max_size,
ss
->
ptr
=
PRNUP
(
sc
,
ss
+
1
);
ss
->
space
=
max_size
;
ss
->
priv
=
sc
;
ss
->
stevedore
=
st
;
if
(
ssg
!=
NULL
)
*
ssg
=
sg
;
return
(
ss
);
...
...
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