Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
slash
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
slash
Commits
95bcaab7
Unverified
Commit
95bcaab7
authored
Apr 17, 2023
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjust to vxid changes in varnish-cache master
parent
b1aa1fc5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
10 deletions
+34
-10
fellow_cache.c
src/fellow_cache.c
+26
-2
fellow_storage.c
src/fellow_storage.c
+7
-7
fellow_obj_attr.h
src/tbl/fellow_obj_attr.h
+1
-1
No files found.
src/fellow_cache.c
View file @
95bcaab7
...
...
@@ -41,6 +41,8 @@
#include "fellow_cache_storage.h"
#include "fellow_tune.h"
#include "foreign/vend.h"
#ifdef TEST_DRIVER
#define FCERR_INJECT
#endif
...
...
@@ -303,6 +305,7 @@ fcsc_next(struct fcscursor *c)
// fdo_flags
#define FDO_F_INLOG 1
#define FDO_F_VXID64 2 // vxid uses 8 bytes
/*
* disk layout
...
...
@@ -743,6 +746,24 @@ fellow_disk_obj_check(const struct fellow_disk_obj *fdo,
return
(
NULL
);
}
/*
* convert old formats to current
*/
static
void
fellow_disk_obj_compat
(
struct
fellow_disk_obj
*
fdo
)
{
uint32_t
vxid
;
CHECK_OBJ_NOTNULL
(
fdo
,
FELLOW_DISK_OBJ_MAGIC
);
if
(
fdo
->
fdo_flags
&
FDO_F_VXID64
)
return
;
vxid
=
vbe32dec
(
fdo
->
fa_vxid
);
vbe64enc
(
fdo
->
fa_vxid
,
(
uint64_t
)
vxid
);
fdo
->
fdo_flags
|=
FDO_F_VXID64
;
}
/* ============================================================
* cache obj
*/
...
...
@@ -1656,6 +1677,7 @@ fellow_busy_obj_alloc(struct fellow_cache *fc,
fdo
->
magic
=
FELLOW_DISK_OBJ_MAGIC
;
fdo
->
version
=
1
;
fdo
->
va_data_len
=
wsl
;
fdo
->
fdo_flags
=
FDO_F_VXID64
;
// disk obj init (allocation happened before)
fds
=
&
fdo
->
fdo_fds
;
...
...
@@ -3739,7 +3761,7 @@ fellow_busy_done(struct fellow_busy *fbo, struct objcore *oc, unsigned inlog)
fellow_disk_seglist_fini
(
fco
->
seglist
.
fdsl
);
AZ
(
fdo
->
fdo_flags
);
AZ
(
fdo
->
fdo_flags
&
FDO_F_INLOG
);
AZ
(
fco
->
oc
);
// XXX still needed with logstate?
if
(
inlog
)
{
...
...
@@ -4055,6 +4077,8 @@ fellow_cache_obj_get(struct fellow_cache *fc,
if
(
err
!=
NULL
)
goto
err
;
fellow_disk_obj_compat
(
fdo
);
fdsl
=
(
void
*
)((
uint8_t
*
)
fdo
+
sizeof
*
fdo
+
fdo
->
va_data_len
);
assert
(
PAOK
(
fdsl
));
// XXX load of folow-up seglists could be async
...
...
@@ -4520,7 +4544,7 @@ iter_sha256(void *priv, unsigned flush, const void *ptr, ssize_t l)
static
const
char
*
const
oatest
[
OA__MAX
]
=
{
[
OA_LEN
]
=
"lenlenle"
,
[
OA_VXID
]
=
"vxid"
,
[
OA_VXID
]
=
"vxid
vxid
"
,
[
OA_FLAGS
]
=
"f"
,
[
OA_GZIPBITS
]
=
"gzipbitsgzipbitsgzipbitsgzipbits"
,
[
OA_LASTMODIFIED
]
=
"lastmodi"
,
...
...
src/fellow_storage.c
View file @
95bcaab7
...
...
@@ -65,7 +65,7 @@ size_t fellow_rndup(const struct fellow_fd *ffd, size_t sz);
buddy_t
*
fellow_dskbuddy
(
struct
fellow_fd
*
ffd
);
static
void
mutate_to_sfeexp
(
struct
objcore
*
oc
,
uint32
_t
xid
);
mutate_to_sfeexp
(
struct
objcore
*
oc
,
vxid
_t
xid
);
static
vtim_real
sfe_ban_earliest_time
(
const
uint8_t
*
banspec
,
unsigned
len
);
static
vtim_real
...
...
@@ -371,11 +371,11 @@ sfemem_objslim(struct worker *wrk, struct objcore *memoc)
{
const
struct
stevedore
*
stv
=
oc_stv
(
wrk
,
memoc
);
const
struct
stvfe
*
stvfe
=
stv_stvfe
(
stv
);
uint32
_t
xid
;
vxid
_t
xid
;
/* for drain, mutate to exp object */
if
(
stvfe
->
shutdown
&&
wrk
->
strangelove
==
(
int
)
STVELOVE_IS_DRAIN
)
{
xid
=
(
uint32_t
)
ObjGetXID
(
wrk
,
memoc
);
xid
=
ObjGetXID
(
wrk
,
memoc
);
sfemem_free
(
wrk
,
memoc
);
mutate_to_sfeexp
(
memoc
,
xid
);
...
...
@@ -455,7 +455,7 @@ sfedsk_objslim(struct worker *wrk, struct objcore *dskoc)
/* for drain, mutate to exp object */
if
(
stvfe
->
shutdown
&&
wrk
->
strangelove
==
(
int
)
STVELOVE_IS_DRAIN
)
{
LRU_Remove
(
dskoc
);
mutate_to_sfeexp
(
dskoc
,
42
);
mutate_to_sfeexp
(
dskoc
,
(
struct
vxids
){
42
}
);
return
;
}
...
...
@@ -861,7 +861,7 @@ static const void * v_matchproto_(objgetattr_f)
sfedsk_getattr
(
struct
worker
*
wrk
,
struct
objcore
*
dskoc
,
enum
obj_attr
attr
,
ssize_t
*
slen
)
{
static
const
uint32_t
zero
=
0
;
static
const
struct
vxids
zero
=
{
0
}
;
if
(
attr
!=
OA_VXID
)
return
(
sfedsk_getattr_tomem
(
wrk
,
dskoc
,
attr
,
slen
));
...
...
@@ -997,7 +997,7 @@ sfeexp_objfree(struct worker *wrk, struct objcore *oc)
wrk
->
stats
->
n_object
--
;
}
#define OA_VXID_LEN
4
#define OA_VXID_LEN
8
static
const
void
*
v_matchproto_
(
objgetattr_f
)
sfeexp_getattr
(
struct
worker
*
wrk
,
struct
objcore
*
oc
,
enum
obj_attr
attr
,
...
...
@@ -1014,7 +1014,7 @@ sfeexp_getattr(struct worker *wrk, struct objcore *oc, enum obj_attr attr,
}
static
void
mutate_to_sfeexp
(
struct
objcore
*
oc
,
uint32
_t
xid
)
mutate_to_sfeexp
(
struct
objcore
*
oc
,
vxid
_t
xid
)
{
CHECK_OBJ_NOTNULL
(
oc
,
OBJCORE_MAGIC
);
...
...
src/tbl/fellow_obj_attr.h
View file @
95bcaab7
...
...
@@ -35,7 +35,7 @@
#ifdef FDO_FIXATTR
FDO_FIXATTR
(
FLAGS
,
flags
,
2
,
1
)
FDO_FIXATTR
(
LEN
,
len
,
8
,
8
)
FDO_FIXATTR
(
VXID
,
vxid
,
8
,
4
)
FDO_FIXATTR
(
VXID
,
vxid
,
8
,
8
)
FDO_FIXATTR
(
LASTMODIFIED
,
lastmodified
,
8
,
8
)
FDO_FIXATTR
(
GZIPBITS
,
gzipbits
,
32
,
32
)
#undef FDO_FIXATTR
...
...
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