Commit 5da2d319 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Move struct object and its methods to storage.h

parent f7e2c156
...@@ -395,18 +395,6 @@ struct storeobj { ...@@ -395,18 +395,6 @@ struct storeobj {
uintptr_t priv2; 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 --------------------------------------------- /* Object core structure ---------------------------------------------
* Objects have sideways references in the binary heap and the LRU list * 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 * and we want to avoid paging in a lot of objects just to move them up
...@@ -531,8 +519,6 @@ struct busyobj { ...@@ -531,8 +519,6 @@ struct busyobj {
/* Object structure --------------------------------------------------*/ /* Object structure --------------------------------------------------*/
VTAILQ_HEAD(storagehead, storage);
enum obj_attr { enum obj_attr {
#define OBJ_ATTR(U, l) OA_##U, #define OBJ_ATTR(U, l) OA_##U,
#include "tbl/obj_attr.h" #include "tbl/obj_attr.h"
...@@ -545,25 +531,6 @@ enum obj_flags { ...@@ -545,25 +531,6 @@ enum obj_flags {
#undef OBJ_FLAG #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 { struct req {
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
struct stv_objsecrets; struct stv_objsecrets;
struct stevedore; struct stevedore;
struct sess; struct sess;
struct dstat;
struct busyobj; struct busyobj;
struct objcore; struct objcore;
struct worker; struct worker;
...@@ -55,6 +56,43 @@ struct storage { ...@@ -55,6 +56,43 @@ struct storage {
unsigned space; 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_init_f(struct stevedore *, int ac, char * const *av);
typedef void storage_open_f(const struct stevedore *); typedef void storage_open_f(const struct stevedore *);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment