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
5da2d319
Commit
5da2d319
authored
Sep 15, 2014
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move struct object and its methods to storage.h
parent
f7e2c156
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
33 deletions
+38
-33
cache.h
bin/varnishd/cache/cache.h
+0
-33
storage.h
bin/varnishd/storage/storage.h
+38
-0
No files found.
bin/varnishd/cache/cache.h
View file @
5da2d319
...
...
@@ -395,18 +395,6 @@ struct storeobj {
uintptr_t
priv2
;
};
typedef
struct
object
*
getobj_f
(
struct
dstat
*
ds
,
struct
objcore
*
oc
);
typedef
void
updatemeta_f
(
struct
objcore
*
oc
,
struct
dstat
*
);
typedef
void
freeobj_f
(
struct
dstat
*
ds
,
struct
objcore
*
oc
);
typedef
struct
lru
*
getlru_f
(
const
struct
objcore
*
oc
);
struct
storeobj_methods
{
getobj_f
*
getobj
;
updatemeta_f
*
updatemeta
;
freeobj_f
*
freeobj
;
getlru_f
*
getlru
;
};
/* Object core structure ---------------------------------------------
* Objects have sideways references in the binary heap and the LRU list
* and we want to avoid paging in a lot of objects just to move them up
...
...
@@ -531,8 +519,6 @@ struct busyobj {
/* Object structure --------------------------------------------------*/
VTAILQ_HEAD
(
storagehead
,
storage
);
enum
obj_attr
{
#define OBJ_ATTR(U, l) OA_##U,
#include "tbl/obj_attr.h"
...
...
@@ -545,25 +531,6 @@ enum obj_flags {
#undef OBJ_FLAG
};
struct
object
{
unsigned
magic
;
#define OBJECT_MAGIC 0x32851d42
struct
storage
*
objstore
;
char
oa_vxid
[
4
];
uint8_t
*
oa_vary
;
uint8_t
*
oa_http
;
uint8_t
oa_flags
[
1
];
char
oa_gzipbits
[
24
];
char
oa_lastmodified
[
8
];
// struct stevedore *stevedore;
struct
storagehead
list
;
ssize_t
len
;
struct
storage
*
esidata
;
};
/*--------------------------------------------------------------------*/
struct
req
{
...
...
bin/varnishd/storage/storage.h
View file @
5da2d319
...
...
@@ -34,6 +34,7 @@
struct
stv_objsecrets
;
struct
stevedore
;
struct
sess
;
struct
dstat
;
struct
busyobj
;
struct
objcore
;
struct
worker
;
...
...
@@ -55,6 +56,43 @@ struct storage {
unsigned
space
;
};
/* Object ------------------------------------------------------------*/
VTAILQ_HEAD
(
storagehead
,
storage
);
struct
object
{
unsigned
magic
;
#define OBJECT_MAGIC 0x32851d42
struct
storage
*
objstore
;
char
oa_vxid
[
4
];
uint8_t
*
oa_vary
;
uint8_t
*
oa_http
;
uint8_t
oa_flags
[
1
];
char
oa_gzipbits
[
24
];
char
oa_lastmodified
[
8
];
struct
storagehead
list
;
ssize_t
len
;
struct
storage
*
esidata
;
};
/* -------------------------------------------------------------------*/
typedef
struct
object
*
getobj_f
(
struct
dstat
*
ds
,
struct
objcore
*
oc
);
typedef
void
updatemeta_f
(
struct
objcore
*
oc
,
struct
dstat
*
);
typedef
void
freeobj_f
(
struct
dstat
*
ds
,
struct
objcore
*
oc
);
typedef
struct
lru
*
getlru_f
(
const
struct
objcore
*
oc
);
struct
storeobj_methods
{
getobj_f
*
getobj
;
updatemeta_f
*
updatemeta
;
freeobj_f
*
freeobj
;
getlru_f
*
getlru
;
};
/* Prototypes --------------------------------------------------------*/
typedef
void
storage_init_f
(
struct
stevedore
*
,
int
ac
,
char
*
const
*
av
);
typedef
void
storage_open_f
(
const
struct
stevedore
*
);
...
...
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