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
fbbcb962
Unverified
Commit
fbbcb962
authored
Nov 06, 2023
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add DBG() to fcsc_next()
... to make it easier to follow the code in fellow_cache_test motivated by #35
parent
2553385d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
fellow_cache.c
src/fellow_cache.c
+11
-7
No files found.
src/fellow_cache.c
View file @
fbbcb962
...
...
@@ -405,6 +405,10 @@ fcsc_next(struct fcscursor *c)
return
(
&
c
->
fcsl
->
segs
[
c
->
u
++
]);
}
#define FCSC_NEXT(c) ( \
DBG("fcsc " #c " %p u=%u nsegs=%u next=%p", c, (c)->u, \
(c)->fdsl->nsegs, (c)->fcsl->next), fcsc_next(c))
/*
* fdo attribues we want to keep our own enum and, consequently, bitfield
* stable. so we define the enum manually and then generate code from the table
...
...
@@ -1460,7 +1464,7 @@ fellow_seglist_regions(const struct fellow_fd *ffd,
fcsc_init
(
&
c
,
fcsl
);
while
((
fcs
=
fcsc_next
(
&
c
))
!=
NULL
)
while
((
fcs
=
FCSC_NEXT
(
&
c
))
!=
NULL
)
fellow_seg_regions
(
ffd
,
fcs
,
region
,
&
n
);
return
(
n
);
}
...
...
@@ -3087,7 +3091,7 @@ fellow_cache_obj_slim(const struct fellow_cache *fc,
AZ
(
pthread_mutex_lock
(
&
fco
->
mtx
));
/* anything to do at all? */
while
((
fcs
=
fcsc_next
(
&
c
))
!=
NULL
)
while
((
fcs
=
FCSC_NEXT
(
&
c
))
!=
NULL
)
if
(
fcs
->
alloc
.
ptr
)
break
;
...
...
@@ -3096,7 +3100,7 @@ fellow_cache_obj_slim(const struct fellow_cache *fc,
fcsc_init
(
&
c
,
&
fco
->
seglist
);
AZ
(
pthread_mutex_lock
(
&
lru
->
lru_mtx
));
while
((
fcs
=
fcsc_next
(
&
c
))
!=
NULL
)
{
while
((
fcs
=
FCSC_NEXT
(
&
c
))
!=
NULL
)
{
if
(
fcs
->
alloc
.
ptr
==
NULL
)
break
;
ref
=
0
;
...
...
@@ -3802,11 +3806,11 @@ fellow_cache_obj_iter(struct fellow_cache *fc, struct fellow_cache_obj *fco,
flags
=
final
?
OBJ_ITER_FLUSH
:
0
;
flush
=
0
;
while
((
fcs
=
fcsc_next
(
&
c
))
!=
NULL
)
{
while
((
fcs
=
FCSC_NEXT
(
&
c
))
!=
NULL
)
{
if
(
ra
[
n
%
mod
]
==
NULL
)
{
assert
(
n
==
ran
);
fcsra
=
fcsc_next
(
&
rac
);
fcsra
=
FCSC_NEXT
(
&
rac
);
assert
(
fcsra
==
fcs
);
ran
++
;
...
...
@@ -3817,7 +3821,7 @@ fellow_cache_obj_iter(struct fellow_cache *fc, struct fellow_cache_obj *fco,
raion
=
0
;
while
(
ran
<=
n
+
readahead
)
{
fcsra
=
fcsc_next
(
&
rac
);
fcsra
=
FCSC_NEXT
(
&
rac
);
if
(
fcsra
==
NULL
)
break
;
raio
[
raion
++
]
=
fcsra
;
...
...
@@ -3867,7 +3871,7 @@ fellow_cache_obj_iter(struct fellow_cache *fc, struct fellow_cache_obj *fco,
*/
AZ
(
flags
&
OBJ_ITER_END
);
nextc
=
c
;
fcsnext
=
fcsc_next
(
&
nextc
);
fcsnext
=
FCSC_NEXT
(
&
nextc
);
flush
=
0
;
if
(
fcs
->
state
==
FCS_BUSY
)
flush
=
OBJ_ITER_FLUSH
;
...
...
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