Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
unique-xids
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
unique-xids
Commits
ef1b8cb1
Commit
ef1b8cb1
authored
Jul 02, 2012
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't hand out zero VXIDs we need that as a magic value.
parent
4c4d6f65
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
24 deletions
+23
-24
cache.h
bin/varnishd/cache/cache.h
+1
-1
cache_main.c
bin/varnishd/cache/cache_main.c
+15
-16
cache_shmlog.c
bin/varnishd/cache/cache_shmlog.c
+7
-7
No files found.
bin/varnishd/cache/cache.h
View file @
ef1b8cb1
...
...
@@ -937,7 +937,7 @@ void *VSM_Alloc(unsigned size, const char *class, const char *type,
void
VSL_Setup
(
struct
vsl_log
*
vsl
,
void
*
ptr
,
size_t
len
);
void
VSM_Free
(
void
*
ptr
);
#ifdef VSL_ENDMARKER
void
VSL
(
enum
VSL_tag_e
tag
,
int
id
,
const
char
*
fmt
,
...)
void
VSL
(
enum
VSL_tag_e
tag
,
uint32_t
vx
id
,
const
char
*
fmt
,
...)
__printflike
(
3
,
4
);
void
VSLb
(
struct
vsl_log
*
,
enum
VSL_tag_e
tag
,
const
char
*
fmt
,
...)
__printflike
(
3
,
4
);
...
...
bin/varnishd/cache/cache_main.c
View file @
ef1b8cb1
...
...
@@ -87,30 +87,29 @@ THR_GetName(void)
/*--------------------------------------------------------------------
* VXID's are unique transaction numbers allocated with a minimum of
* locking overhead via pools in the worker threads.
*
* VXID's are mostly for use in VSL and for that reason we never return
* zero vxid, in order to reserve that for "unassociated" VSL records.
*/
static
uint32_t
vxid_base
;
static
struct
lock
vxid_lock
;
static
void
vxid_More
(
struct
vxid_pool
*
v
)
uint32_t
VXID_Get
(
struct
vxid_pool
*
v
)
{
do
{
if
(
v
->
count
==
0
)
{
Lck_Lock
(
&
vxid_lock
);
v
->
next
=
vxid_base
;
v
->
count
=
32768
;
vxid_base
=
v
->
count
;
Lck_Unlock
(
&
vxid_lock
);
}
uint32_t
VXID_Get
(
struct
vxid_pool
*
v
)
{
if
(
v
->
count
==
0
)
vxid_More
(
v
);
AN
(
v
->
count
);
}
v
->
count
--
;
return
(
v
->
next
++
);
v
->
next
++
;
}
while
(
v
->
next
==
0
);
return
(
v
->
next
);
}
/*--------------------------------------------------------------------
...
...
bin/varnishd/cache/cache_shmlog.c
View file @
ef1b8cb1
...
...
@@ -61,12 +61,12 @@ vsl_w0(uint32_t type, uint32_t length)
/*--------------------------------------------------------------------*/
static
inline
void
vsl_hdr
(
enum
VSL_tag_e
tag
,
uint32_t
*
p
,
unsigned
len
,
u
nsigned
id
)
vsl_hdr
(
enum
VSL_tag_e
tag
,
uint32_t
*
p
,
unsigned
len
,
u
int32_t
vx
id
)
{
assert
(((
uintptr_t
)
p
&
0x3
)
==
0
);
p
[
1
]
=
id
;
p
[
1
]
=
vx
id
;
VMB
();
p
[
0
]
=
vsl_w0
(
tag
,
len
);
}
...
...
@@ -133,7 +133,7 @@ vsl_get(unsigned len, unsigned records, unsigned flushes)
*/
static
void
vslr
(
enum
VSL_tag_e
tag
,
int
id
,
const
char
*
b
,
unsigned
len
)
vslr
(
enum
VSL_tag_e
tag
,
uint32_t
vx
id
,
const
char
*
b
,
unsigned
len
)
{
uint32_t
*
p
;
unsigned
mlen
;
...
...
@@ -147,13 +147,13 @@ vslr(enum VSL_tag_e tag, int id, const char *b, unsigned len)
p
=
vsl_get
(
len
,
1
,
0
);
memcpy
(
p
+
2
,
b
,
len
);
vsl_hdr
(
tag
,
p
,
len
,
id
);
vsl_hdr
(
tag
,
p
,
len
,
vx
id
);
}
/*--------------------------------------------------------------------*/
void
VSL
(
enum
VSL_tag_e
tag
,
int
id
,
const
char
*
fmt
,
...)
VSL
(
enum
VSL_tag_e
tag
,
uint32_t
vx
id
,
const
char
*
fmt
,
...)
{
va_list
ap
;
unsigned
n
,
mlen
=
cache_param
->
shm_reclen
;
...
...
@@ -167,12 +167,12 @@ VSL(enum VSL_tag_e tag, int id, const char *fmt, ...)
va_start
(
ap
,
fmt
);
if
(
strchr
(
fmt
,
'%'
)
==
NULL
)
{
vslr
(
tag
,
id
,
fmt
,
strlen
(
fmt
));
vslr
(
tag
,
vx
id
,
fmt
,
strlen
(
fmt
));
}
else
{
n
=
vsnprintf
(
buf
,
mlen
,
fmt
,
ap
);
if
(
n
>
mlen
)
n
=
mlen
;
vslr
(
tag
,
id
,
buf
,
n
);
vslr
(
tag
,
vx
id
,
buf
,
n
);
}
va_end
(
ap
);
}
...
...
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