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
f7e2c156
Commit
f7e2c156
authored
Sep 15, 2014
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reintegrate struct body into struct object.
parent
a2d16c17
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
28 deletions
+22
-28
cache.h
bin/varnishd/cache/cache.h
+4
-9
cache_obj.c
bin/varnishd/cache/cache_obj.c
+15
-15
stevedore.c
bin/varnishd/storage/stevedore.c
+1
-2
storage_persistent_silo.c
bin/varnishd/storage/storage_persistent_silo.c
+2
-2
No files found.
bin/varnishd/cache/cache.h
View file @
f7e2c156
...
...
@@ -104,7 +104,6 @@ enum {
struct
SHA256Context
;
struct
VSC_C_lck
;
struct
ban
;
struct
body
;
struct
busyobj
;
struct
cli
;
struct
cli_proto
;
...
...
@@ -391,7 +390,7 @@ struct lru {
struct
storeobj
{
unsigned
magic
;
#define STOREOBJ_MAGIC 0x6faed850
const
struct
stevedore
*
stevedore
;
struct
stevedore
*
stevedore
;
void
*
priv
;
uintptr_t
priv2
;
};
...
...
@@ -534,12 +533,6 @@ struct busyobj {
VTAILQ_HEAD
(
storagehead
,
storage
);
struct
body
{
struct
stevedore
*
stevedore
;
struct
storagehead
list
;
ssize_t
len
;
};
enum
obj_attr
{
#define OBJ_ATTR(U, l) OA_##U,
#include "tbl/obj_attr.h"
...
...
@@ -564,7 +557,9 @@ struct object {
char
oa_gzipbits
[
24
];
char
oa_lastmodified
[
8
];
struct
body
body
[
1
];
// struct stevedore *stevedore;
struct
storagehead
list
;
ssize_t
len
;
struct
storage
*
esidata
;
};
...
...
bin/varnishd/cache/cache_obj.c
View file @
f7e2c156
...
...
@@ -116,7 +116,7 @@ ObjIter(struct objiter *oi, void **p, ssize_t *l)
if
(
oi
->
bo
==
NULL
)
{
if
(
oi
->
st
==
NULL
)
oi
->
st
=
VTAILQ_FIRST
(
&
oi
->
obj
->
body
->
list
);
oi
->
st
=
VTAILQ_FIRST
(
&
oi
->
obj
->
list
);
else
oi
->
st
=
VTAILQ_NEXT
(
oi
->
st
,
list
);
while
(
oi
->
st
!=
NULL
&&
oi
->
st
->
len
==
0
)
...
...
@@ -140,8 +140,8 @@ ObjIter(struct objiter *oi, void **p, ssize_t *l)
return
(
OIS_ERROR
);
}
Lck_Lock
(
&
oi
->
bo
->
mtx
);
AZ
(
VTAILQ_EMPTY
(
&
oi
->
obj
->
body
->
list
));
VTAILQ_FOREACH
(
oi
->
st
,
&
oi
->
obj
->
body
->
list
,
list
)
{
AZ
(
VTAILQ_EMPTY
(
&
oi
->
obj
->
list
));
VTAILQ_FOREACH
(
oi
->
st
,
&
oi
->
obj
->
list
,
list
)
{
if
(
oi
->
st
->
len
>
ol
)
{
*
p
=
oi
->
st
->
ptr
+
ol
;
*
l
=
oi
->
st
->
len
-
ol
;
...
...
@@ -231,7 +231,7 @@ ObjGetSpace(struct objcore *oc, struct vsl_log *vsl, struct dstat *ds,
o
=
obj_getobj
(
oc
,
ds
);
CHECK_OBJ_NOTNULL
(
o
,
OBJECT_MAGIC
);
st
=
VTAILQ_LAST
(
&
o
->
body
->
list
,
storagehead
);
st
=
VTAILQ_LAST
(
&
o
->
list
,
storagehead
);
if
(
st
!=
NULL
&&
st
->
len
<
st
->
space
)
{
*
sz
=
st
->
space
-
st
->
len
;
*
ptr
=
st
->
ptr
+
st
->
len
;
...
...
@@ -239,17 +239,17 @@ ObjGetSpace(struct objcore *oc, struct vsl_log *vsl, struct dstat *ds,
return
(
1
);
}
st
=
objallocwithnuke
(
o
->
body
->
stevedore
,
vsl
,
ds
,
*
sz
);
st
=
objallocwithnuke
(
o
c
->
stobj
->
stevedore
,
vsl
,
ds
,
*
sz
);
if
(
st
==
NULL
)
return
(
0
);
if
(
oc
->
busyobj
!=
NULL
)
{
CHECK_OBJ_NOTNULL
(
oc
->
busyobj
,
BUSYOBJ_MAGIC
);
Lck_Lock
(
&
oc
->
busyobj
->
mtx
);
VTAILQ_INSERT_TAIL
(
&
o
->
body
->
list
,
st
,
list
);
VTAILQ_INSERT_TAIL
(
&
o
->
list
,
st
,
list
);
Lck_Unlock
(
&
oc
->
busyobj
->
mtx
);
}
else
{
VTAILQ_INSERT_TAIL
(
&
o
->
body
->
list
,
st
,
list
);
VTAILQ_INSERT_TAIL
(
&
o
->
list
,
st
,
list
);
}
*
sz
=
st
->
space
-
st
->
len
;
assert
(
*
sz
>
0
);
...
...
@@ -269,11 +269,11 @@ ObjExtend(struct objcore *oc, struct dstat *ds, ssize_t l)
CHECK_OBJ_NOTNULL
(
oc
,
OBJCORE_MAGIC
);
o
=
obj_getobj
(
oc
,
ds
);
CHECK_OBJ_NOTNULL
(
o
,
OBJECT_MAGIC
);
st
=
VTAILQ_LAST
(
&
o
->
body
->
list
,
storagehead
);
st
=
VTAILQ_LAST
(
&
o
->
list
,
storagehead
);
CHECK_OBJ_NOTNULL
(
st
,
STORAGE_MAGIC
);
assert
(
st
->
len
+
l
<=
st
->
space
);
st
->
len
+=
l
;
o
->
body
->
len
+=
l
;
o
->
len
+=
l
;
}
/*--------------------------------------------------------------------
...
...
@@ -292,11 +292,11 @@ ObjTrimStore(struct objcore *oc, struct dstat *ds)
CHECK_OBJ_NOTNULL
(
stv
,
STEVEDORE_MAGIC
);
o
=
obj_getobj
(
oc
,
ds
);
CHECK_OBJ_NOTNULL
(
o
,
OBJECT_MAGIC
);
st
=
VTAILQ_LAST
(
&
o
->
body
->
list
,
storagehead
);
st
=
VTAILQ_LAST
(
&
o
->
list
,
storagehead
);
if
(
st
==
NULL
)
return
;
if
(
st
->
len
==
0
)
{
VTAILQ_REMOVE
(
&
o
->
body
->
list
,
st
,
list
);
VTAILQ_REMOVE
(
&
o
->
list
,
st
,
list
);
STV_free
(
st
);
}
else
if
(
st
->
len
<
st
->
space
)
{
STV_trim
(
st
,
st
->
len
,
1
);
...
...
@@ -322,9 +322,9 @@ ObjSlim(struct objcore *oc, struct dstat *ds)
STV_free
(
o
->
esidata
);
o
->
esidata
=
NULL
;
}
VTAILQ_FOREACH_SAFE
(
st
,
&
o
->
body
->
list
,
list
,
stn
)
{
VTAILQ_FOREACH_SAFE
(
st
,
&
o
->
list
,
list
,
stn
)
{
CHECK_OBJ_NOTNULL
(
st
,
STORAGE_MAGIC
);
VTAILQ_REMOVE
(
&
o
->
body
->
list
,
st
,
list
);
VTAILQ_REMOVE
(
&
o
->
list
,
st
,
list
);
STV_free
(
st
);
}
}
...
...
@@ -418,7 +418,7 @@ ObjSetattr(const struct vfp_ctx *vc, enum obj_attr attr, ssize_t len,
st
=
o
->
objstore
;
switch
(
attr
)
{
case
OA_ESIDATA
:
o
->
esidata
=
objallocwithnuke
(
o
->
body
->
stevedore
,
vc
->
vsl
,
o
->
esidata
=
objallocwithnuke
(
vc
->
oc
->
stobj
->
stevedore
,
vc
->
vsl
,
vc
->
stats
,
len
);
if
(
o
->
esidata
==
NULL
)
return
(
NULL
);
...
...
@@ -498,7 +498,7 @@ ObjGetLen(struct objcore *oc, struct dstat *ds)
o
=
obj_getobj
(
oc
,
ds
);
CHECK_OBJ_NOTNULL
(
o
,
OBJECT_MAGIC
);
return
(
o
->
body
->
len
);
return
(
o
->
len
);
}
/*--------------------------------------------------------------------
...
...
bin/varnishd/storage/stevedore.c
View file @
f7e2c156
...
...
@@ -202,11 +202,10 @@ STV_MkObject(struct stevedore *stv, struct objcore *oc, void *ptr)
memset
(
o
,
0
,
sizeof
*
o
);
o
->
magic
=
OBJECT_MAGIC
;
VTAILQ_INIT
(
&
o
->
body
->
list
);
VTAILQ_INIT
(
&
o
->
list
);
oc
->
stobj
->
magic
=
STOREOBJ_MAGIC
;
oc
->
stobj
->
stevedore
=
stv
;
o
->
body
->
stevedore
=
stv
;
AN
(
stv
->
methods
);
oc
->
stobj
->
priv
=
o
;
oc
->
stobj
->
priv2
=
(
uintptr_t
)
stv
;
...
...
bin/varnishd/storage/storage_persistent_silo.c
View file @
f7e2c156
...
...
@@ -432,13 +432,13 @@ smp_oc_getobj(struct dstat *ds, struct objcore *oc)
bad
=
0
;
l
=
0
;
VTAILQ_FOREACH
(
st
,
&
o
->
body
->
list
,
list
)
{
VTAILQ_FOREACH
(
st
,
&
o
->
list
,
list
)
{
bad
|=
smp_loaded_st
(
sg
->
sc
,
sg
,
st
);
if
(
bad
)
break
;
l
+=
st
->
len
;
}
if
(
l
!=
o
->
body
->
len
)
if
(
l
!=
o
->
len
)
bad
|=
0x100
;
if
(
bad
)
{
...
...
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