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
1a190195
Commit
1a190195
authored
Jun 12, 2023
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename VSM "classes" to "categories"
parent
90361196
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
35 additions
and
35 deletions
+35
-35
common_vsc.c
bin/varnishd/common/common_vsc.c
+4
-4
common_vsmw.c
bin/varnishd/common/common_vsmw.c
+9
-9
mgt.h
bin/varnishd/mgt/mgt.h
+1
-1
mgt_shmem.c
bin/varnishd/mgt/mgt_shmem.c
+2
-2
vsc.h
include/vapi/vsc.h
+1
-1
vsm.h
include/vapi/vsm.h
+6
-6
vsc.c
lib/libvarnishapi/vsc.c
+5
-5
vsm.c
lib/libvarnishapi/vsm.c
+7
-7
No files found.
bin/varnishd/common/common_vsc.c
View file @
1a190195
...
...
@@ -83,14 +83,14 @@ vsm_lock_f *vsc_unlock = vsc_dummy_lock;
static
const
size_t
vsc_overhead
=
PRNDUP
(
sizeof
(
struct
vsc_head
));
static
struct
vsc_seg
*
vrt_vsc_mksegv
(
struct
vsmw_cluster
*
vc
,
const
char
*
c
lass
,
vrt_vsc_mksegv
(
struct
vsmw_cluster
*
vc
,
const
char
*
c
ategory
,
size_t
payload
,
const
char
*
fmt
,
va_list
va
)
{
struct
vsc_seg
*
vsg
;
ALLOC_OBJ
(
vsg
,
VSC_SEG_MAGIC
);
AN
(
vsg
);
vsg
->
seg
=
VSMW_Allocv
(
heritage
.
proc_vsmw
,
vc
,
c
lass
,
vsg
->
seg
=
VSMW_Allocv
(
heritage
.
proc_vsmw
,
vc
,
c
ategory
,
VRT_VSC_Overhead
(
payload
),
fmt
,
va
);
AN
(
vsg
->
seg
);
vsg
->
vsm
=
heritage
.
proc_vsmw
;
...
...
@@ -101,13 +101,13 @@ vrt_vsc_mksegv(struct vsmw_cluster *vc, const char *class,
}
static
struct
vsc_seg
*
vrt_vsc_mksegf
(
const
char
*
c
lass
,
size_t
payload
,
const
char
*
fmt
,
...)
vrt_vsc_mksegf
(
const
char
*
c
ategory
,
size_t
payload
,
const
char
*
fmt
,
...)
{
va_list
ap
;
struct
vsc_seg
*
vsg
;
va_start
(
ap
,
fmt
);
vsg
=
vrt_vsc_mksegv
(
NULL
,
c
lass
,
payload
,
fmt
,
ap
);
vsg
=
vrt_vsc_mksegv
(
NULL
,
c
ategory
,
payload
,
fmt
,
ap
);
va_end
(
ap
);
return
(
vsg
);
}
...
...
bin/varnishd/common/common_vsmw.c
View file @
1a190195
...
...
@@ -114,7 +114,7 @@ struct vsmwseg {
VTAILQ_ENTRY
(
vsmwseg
)
list
;
struct
vsmw_cluster
*
cluster
;
char
*
c
lass
;
char
*
c
ategory
;
size_t
off
;
size_t
len
;
char
*
id
;
...
...
@@ -163,7 +163,7 @@ vsmw_fmt_index(const struct vsmw *vsmw, const struct vsmwseg *seg, char act)
seg
->
cluster
->
fn
,
seg
->
off
,
seg
->
len
,
seg
->
c
lass
,
seg
->
c
ategory
,
seg
->
id
);
}
...
...
@@ -257,7 +257,7 @@ vsmw_delseg(struct vsmw *vsmw, struct vsmwseg *seg)
REPLACE
(
t
,
NULL
);
vsmw
->
nsubs
=
0
;
}
REPLACE
(
seg
->
c
lass
,
NULL
);
REPLACE
(
seg
->
c
ategory
,
NULL
);
REPLACE
(
seg
->
id
,
NULL
);
FREE_OBJ
(
seg
);
}
...
...
@@ -317,7 +317,7 @@ VSMW_NewCluster(struct vsmw *vsmw, size_t len, const char *pfx)
vc
->
cseg
=
seg
;
seg
->
len
=
vc
->
len
;
seg
->
cluster
=
vc
;
REPLACE
(
seg
->
c
lass
,
""
);
REPLACE
(
seg
->
c
ategory
,
""
);
REPLACE
(
seg
->
id
,
""
);
vc
->
refs
++
;
vc
->
named
=
1
;
...
...
@@ -365,7 +365,7 @@ VSMW_DestroyCluster(struct vsmw *vsmw, struct vsmw_cluster **vsmcp)
void
*
VSMW_Allocv
(
struct
vsmw
*
vsmw
,
struct
vsmw_cluster
*
vc
,
const
char
*
c
lass
,
size_t
payload
,
const
char
*
c
ategory
,
size_t
payload
,
const
char
*
fmt
,
va_list
va
)
{
struct
vsmwseg
*
seg
;
...
...
@@ -375,7 +375,7 @@ VSMW_Allocv(struct vsmw *vsmw, struct vsmw_cluster *vc,
ALLOC_OBJ
(
seg
,
VSMWSEG_MAGIC
);
AN
(
seg
);
REPLACE
(
seg
->
c
lass
,
class
);
REPLACE
(
seg
->
c
ategory
,
category
);
seg
->
len
=
PRNDUP
(
payload
);
VSB_clear
(
vsmw
->
vsb
);
...
...
@@ -384,7 +384,7 @@ VSMW_Allocv(struct vsmw *vsmw, struct vsmw_cluster *vc,
REPLACE
(
seg
->
id
,
VSB_data
(
vsmw
->
vsb
));
if
(
vc
==
NULL
)
vc
=
vsmw_newcluster
(
vsmw
,
seg
->
len
,
c
lass
);
vc
=
vsmw_newcluster
(
vsmw
,
seg
->
len
,
c
ategory
);
AN
(
vc
);
vc
->
refs
++
;
...
...
@@ -402,13 +402,13 @@ VSMW_Allocv(struct vsmw *vsmw, struct vsmw_cluster *vc,
void
*
VSMW_Allocf
(
struct
vsmw
*
vsmw
,
struct
vsmw_cluster
*
vc
,
const
char
*
c
lass
,
size_t
len
,
const
char
*
fmt
,
...)
const
char
*
c
ategory
,
size_t
len
,
const
char
*
fmt
,
...)
{
va_list
ap
;
void
*
p
;
va_start
(
ap
,
fmt
);
p
=
VSMW_Allocv
(
vsmw
,
vc
,
c
lass
,
len
,
fmt
,
ap
);
p
=
VSMW_Allocv
(
vsmw
,
vc
,
c
ategory
,
len
,
fmt
,
ap
);
va_end
(
ap
);
return
(
p
);
}
...
...
bin/varnishd/mgt/mgt.h
View file @
1a190195
...
...
@@ -196,7 +196,7 @@ extern struct params mgt_param;
/* mgt_shmem.c */
void
mgt_SHM_Init
(
void
);
void
mgt_SHM_static_alloc
(
const
void
*
,
ssize_t
size
,
const
char
*
c
lass
,
const
char
*
ident
);
const
char
*
c
ategory
,
const
char
*
ident
);
void
mgt_SHM_Create
(
void
);
void
mgt_SHM_Destroy
(
int
keep
);
...
...
bin/varnishd/mgt/mgt_shmem.c
View file @
1a190195
...
...
@@ -55,11 +55,11 @@ static struct vsmw *mgt_vsmw;
void
mgt_SHM_static_alloc
(
const
void
*
ptr
,
ssize_t
size
,
const
char
*
c
lass
,
const
char
*
ident
)
const
char
*
c
ategory
,
const
char
*
ident
)
{
void
*
p
;
p
=
VSMW_Allocf
(
mgt_vsmw
,
NULL
,
c
lass
,
size
,
"%s"
,
ident
);
p
=
VSMW_Allocf
(
mgt_vsmw
,
NULL
,
c
ategory
,
size
,
"%s"
,
ident
);
AN
(
p
);
memcpy
(
p
,
ptr
,
size
);
}
...
...
include/vapi/vsc.h
View file @
1a190195
...
...
@@ -30,7 +30,7 @@
*
* This is the public API for the VSC access.
*
* VSC is a
"subclass"
of VSM.
* VSC is a
sub-category
of VSM.
*
*/
...
...
include/vapi/vsm.h
View file @
1a190195
...
...
@@ -31,7 +31,7 @@
*
* This is the public API for the VSM access.
*
* The VSM
"class" acts as parent class for the VSL and VSC subclass
es.
* The VSM
category acts as parent category for the VSL and VSC sub-categori
es.
*
*/
...
...
@@ -49,7 +49,7 @@ struct vsm_fantom {
uintptr_t
priv2
;
/* VSM private */
void
*
b
;
/* first byte of payload */
void
*
e
;
/* first byte past payload */
char
*
c
lass
;
char
*
c
ategory
;
char
*
ident
;
};
...
...
@@ -73,7 +73,7 @@ struct vsm *VSM_New(void);
void
VSM_Destroy
(
struct
vsm
**
vd
);
/*
* Close and deallocate all storage and mappings.
* (including any VSC and VSL "sub-c
lasses
" XXX?)
* (including any VSC and VSL "sub-c
ategory
" XXX?)
*/
const
char
*
VSM_Error
(
const
struct
vsm
*
vd
);
...
...
@@ -173,14 +173,14 @@ const struct vsm_valid *VSM_StillValid(const struct vsm *, const struct vsm_fant
*/
int
VSM_Get
(
struct
vsm
*
,
struct
vsm_fantom
*
vf
,
const
char
*
c
lass
,
const
char
*
ident
);
const
char
*
c
ategory
,
const
char
*
ident
);
/*
* Find a chunk, produce fantom for it.
* Returns zero on failure.
* c
lass
is mandatory, ident optional.
* c
ategory
is mandatory, ident optional.
*/
char
*
VSM_Dup
(
struct
vsm
*
,
const
char
*
c
lass
,
const
char
*
ident
);
char
*
VSM_Dup
(
struct
vsm
*
,
const
char
*
c
ategory
,
const
char
*
ident
);
/*
* Returns a malloc'ed copy of the fanton.
*
...
...
lib/libvarnishapi/vsc.c
View file @
1a190195
...
...
@@ -362,7 +362,7 @@ vsc_add_seg(const struct vsc *vsc, struct vsm *vsm, const struct vsm_fantom *fp)
assert
(
sp
->
head
->
ready
>
0
);
sp
->
body
=
(
char
*
)
sp
->
fantom
->
b
+
sp
->
head
->
body_offset
;
if
(
!
strcmp
(
fp
->
c
lass
,
VSC_CLASS
))
{
if
(
!
strcmp
(
fp
->
c
ategory
,
VSC_CLASS
))
{
VTAILQ_FOREACH
(
spd
,
&
vsc
->
segs
,
list
)
if
(
spd
->
head
->
doc_id
==
sp
->
head
->
doc_id
)
break
;
...
...
@@ -385,7 +385,7 @@ vsc_add_seg(const struct vsc *vsc, struct vsm *vsm, const struct vsm_fantom *fp)
VSB_destroy
(
&
vsb
);
return
(
sp
);
}
assert
(
!
strcmp
(
fp
->
c
lass
,
VSC_DOC_CLASS
));
assert
(
!
strcmp
(
fp
->
c
ategory
,
VSC_DOC_CLASS
));
sp
->
vj
=
vjsn_parse
(
sp
->
body
,
&
e
);
XXXAZ
(
e
);
AN
(
sp
->
vj
);
...
...
@@ -456,9 +456,9 @@ VSC_Iter(struct vsc *vsc, struct vsm *vsm, VSC_iter_f *fiter, void *priv)
AN
(
vsm
);
sp
=
VTAILQ_FIRST
(
&
vsc
->
segs
);
VSM_FOREACH
(
&
ifantom
,
vsm
)
{
AN
(
ifantom
.
c
lass
);
if
(
strcmp
(
ifantom
.
c
lass
,
VSC_CLASS
)
&&
strcmp
(
ifantom
.
c
lass
,
VSC_DOC_CLASS
))
AN
(
ifantom
.
c
ategory
);
if
(
strcmp
(
ifantom
.
c
ategory
,
VSC_CLASS
)
&&
strcmp
(
ifantom
.
c
ategory
,
VSC_DOC_CLASS
))
continue
;
while
(
sp
!=
NULL
&&
(
strcmp
(
ifantom
.
ident
,
sp
->
fantom
->
ident
)
||
...
...
lib/libvarnishapi/vsm.c
View file @
1a190195
...
...
@@ -878,9 +878,9 @@ VSM__itern(struct vsm *vd, struct vsm_fantom *vf)
memset
(
vf
,
0
,
sizeof
*
vf
);
vf
->
priv
=
VSM_PRIV_MERGE
(
vg
->
serial
,
vd
->
serial
);
vf
->
priv2
=
(
uintptr_t
)
vg
;
vf
->
c
lass
=
vg
->
av
[
4
];
vf
->
c
ategory
=
vg
->
av
[
4
];
vf
->
ident
=
vg
->
av
[
5
];
AN
(
vf
->
c
lass
);
AN
(
vf
->
c
ategory
);
return
(
1
);
}
...
...
@@ -901,7 +901,7 @@ VSM_Map(struct vsm *vd, struct vsm_fantom *vf)
return
(
vsm_diag
(
vd
,
"VSM_Map: bad fantom"
));
assert
(
vg
->
serial
==
VSM_PRIV_LOW
(
vf
->
priv
));
assert
(
vg
->
av
[
4
]
==
vf
->
c
lass
);
assert
(
vg
->
av
[
4
]
==
vf
->
c
ategory
);
assert
(
vg
->
av
[
5
]
==
vf
->
ident
);
if
(
vg
->
b
!=
NULL
)
{
...
...
@@ -1018,13 +1018,13 @@ VSM_StillValid(const struct vsm *vd, const struct vsm_fantom *vf)
int
VSM_Get
(
struct
vsm
*
vd
,
struct
vsm_fantom
*
vf
,
const
char
*
c
lass
,
const
char
*
ident
)
const
char
*
c
ategory
,
const
char
*
ident
)
{
CHECK_OBJ_NOTNULL
(
vd
,
VSM_MAGIC
);
AN
(
vd
->
attached
);
VSM_FOREACH
(
vf
,
vd
)
{
if
(
strcmp
(
vf
->
c
lass
,
class
))
if
(
strcmp
(
vf
->
c
ategory
,
category
))
continue
;
if
(
ident
!=
NULL
&&
strcmp
(
vf
->
ident
,
ident
))
continue
;
...
...
@@ -1037,7 +1037,7 @@ VSM_Get(struct vsm *vd, struct vsm_fantom *vf,
/*--------------------------------------------------------------------*/
char
*
VSM_Dup
(
struct
vsm
*
vd
,
const
char
*
c
lass
,
const
char
*
ident
)
VSM_Dup
(
struct
vsm
*
vd
,
const
char
*
c
ategory
,
const
char
*
ident
)
{
struct
vsm_fantom
vf
;
char
*
p
=
NULL
;
...
...
@@ -1045,7 +1045,7 @@ VSM_Dup(struct vsm *vd, const char *class, const char *ident)
CHECK_OBJ_NOTNULL
(
vd
,
VSM_MAGIC
);
AN
(
vd
->
attached
);
VSM_FOREACH
(
&
vf
,
vd
)
{
if
(
strcmp
(
vf
.
c
lass
,
class
))
if
(
strcmp
(
vf
.
c
ategory
,
category
))
continue
;
if
(
ident
!=
NULL
&&
strcmp
(
vf
.
ident
,
ident
))
continue
;
...
...
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