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
ef400bba
Commit
ef400bba
authored
May 24, 2024
by
Dridi Boukelmoune
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vsm: Extract vsm_set_findseg() function
parent
32574ab4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
21 deletions
+19
-21
vsm.c
lib/libvarnishapi/vsm.c
+19
-21
No files found.
lib/libvarnishapi/vsm.c
View file @
ef400bba
...
@@ -790,10 +790,25 @@ VSM_Attach(struct vsm *vd, int progress)
...
@@ -790,10 +790,25 @@ VSM_Attach(struct vsm *vd, int progress)
/*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*/
static
struct
vsm_seg
*
vsm_set_findseg
(
const
struct
vsm_set
*
vs
,
uintptr_t
serial
)
{
struct
vsm_seg
*
vg
;
VTAILQ_FOREACH
(
vg
,
&
vs
->
segs
,
list
)
{
if
(
vg
->
serial
==
serial
)
return
(
vg
);
}
VTAILQ_FOREACH
(
vg
,
&
vs
->
stale
,
list
)
{
if
(
vg
->
serial
==
serial
)
return
(
vg
);
}
return
(
NULL
);
}
static
struct
vsm_seg
*
static
struct
vsm_seg
*
vsm_findseg
(
const
struct
vsm
*
vd
,
const
struct
vsm_fantom
*
vf
)
vsm_findseg
(
const
struct
vsm
*
vd
,
const
struct
vsm_fantom
*
vf
)
{
{
struct
vsm_set
*
vs
;
struct
vsm_seg
*
vg
;
struct
vsm_seg
*
vg
;
uint64_t
x
;
uint64_t
x
;
...
@@ -807,26 +822,9 @@ vsm_findseg(const struct vsm *vd, const struct vsm_fantom *vf)
...
@@ -807,26 +822,9 @@ vsm_findseg(const struct vsm *vd, const struct vsm_fantom *vf)
}
}
x
=
VSM_PRIV_LOW
(
vf
->
priv
);
x
=
VSM_PRIV_LOW
(
vf
->
priv
);
vs
=
vd
->
mgt
;
vg
=
vsm_set_findseg
(
vd
->
mgt
,
x
);
VTAILQ_FOREACH
(
vg
,
&
vs
->
segs
,
list
)
if
(
vg
==
NULL
)
if
(
vg
->
serial
==
x
)
vg
=
vsm_set_findseg
(
vd
->
child
,
x
);
break
;
if
(
vg
==
NULL
)
{
VTAILQ_FOREACH
(
vg
,
&
vs
->
stale
,
list
)
if
(
vg
->
serial
==
x
)
break
;
}
vs
=
vd
->
child
;
if
(
vg
==
NULL
)
{
VTAILQ_FOREACH
(
vg
,
&
vs
->
segs
,
list
)
if
(
vg
->
serial
==
x
)
break
;
}
if
(
vg
==
NULL
)
{
VTAILQ_FOREACH
(
vg
,
&
vs
->
stale
,
list
)
if
(
vg
->
serial
==
x
)
break
;
}
if
(
vg
==
NULL
)
if
(
vg
==
NULL
)
return
(
NULL
);
return
(
NULL
);
...
...
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