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
2835cb61
Unverified
Commit
2835cb61
authored
Feb 28, 2023
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sfemem_iterator: fix readahead for when segments are not yet available
parent
28409980
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
4 deletions
+21
-4
fellow_cache.c
src/fellow_cache.c
+21
-4
No files found.
src/fellow_cache.c
View file @
2835cb61
...
...
@@ -3062,6 +3062,18 @@ fcs_state_read_needwait(enum fcos_state s)
}
}
/*
* ra[] is a ring of pointers to fcses which we (potentially)
* read ahead.
*
* ra[n % mod] is the current fcs, anything after that are read
* aheads.
* ran the next element to be read ahead
*
* c is a cursor tracking the current fcs
* rac is a cursor tracking the read ahead
*
*/
struct
fellow_cache_res
fellow_cache_obj_iter
(
struct
fellow_cache
*
fc
,
struct
fellow_cache_obj
*
fco
,
void
*
priv
,
objiterate_f
func
,
int
final
)
...
...
@@ -3090,26 +3102,30 @@ fellow_cache_obj_iter(struct fellow_cache *fc, struct fellow_cache_obj *fco,
fcsc_init
(
&
c
,
&
fco
->
seglist
);
rac
=
c
;
(
void
)
fcsc_next
(
&
rac
);
nextc
=
rac
;
flags
=
final
?
OBJ_ITER_FLUSH
:
0
;
flush
=
0
;
while
((
fcs
=
fcsc_next
(
&
c
))
!=
NULL
)
{
if
(
ra
[
n
%
mod
]
==
NULL
)
{
assert
(
n
==
ran
);
fcsra
=
fcsc_next
(
&
rac
);
assert
(
fcsra
==
fcs
);
ran
++
;
fellow_cache_seg_ref_in
(
fc
,
FCIO_SYNC
,
&
fcs
,
1
);
ra
[
n
%
mod
]
=
fcs
;
}
assert
(
ra
[
n
%
mod
]
==
fcs
);
raion
=
0
;
while
(
ran
<
n
+
readahead
)
{
while
(
ran
<
=
n
+
readahead
)
{
fcsra
=
fcsc_next
(
&
rac
);
if
(
fcsra
==
NULL
)
break
;
ran
++
;
raio
[
raion
++
]
=
fcsra
;
TAKEZN
(
ra
[
ran
%
mod
],
fcsra
);
ran
++
;
}
if
(
raion
)
fellow_cache_seg_ref_in
(
fc
,
FCIO_ASYNC
,
...
...
@@ -3153,6 +3169,7 @@ fellow_cache_obj_iter(struct fellow_cache *fc, struct fellow_cache_obj *fco,
* derefn == mod - 1 == 0
*/
AZ
(
flags
&
OBJ_ITER_END
);
nextc
=
c
;
fcsnext
=
fcsc_next
(
&
nextc
);
flush
=
0
;
if
(
fcsnext
==
NULL
||
fcsnext
->
state
==
FCS_USABLE
)
{
...
...
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