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
a07c842c
Unverified
Commit
a07c842c
authored
Dec 21, 2023
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fellow_busy: Redo ..._body_seg_alloc in preparation for async allocations
parent
7f273f0d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
6 deletions
+24
-6
fellow_cache.c
src/fellow_cache.c
+24
-6
No files found.
src/fellow_cache.c
View file @
a07c842c
...
...
@@ -2458,7 +2458,8 @@ fellow_busy_body_seg_alloc(struct fellow_busy *fbo,
struct
fellow_disk_seg
*
fds
,
size_t
want
)
{
struct
fellow_body_region
*
fbr
;
struct
buddy_off_extent
*
fdr
;
struct
buddy_off_extent
reg
,
*
fdr
;
struct
buddy_reqs
*
reqs
;
struct
fellow_cache
*
fc
;
struct
szc
szc
;
size_t
spc
;
...
...
@@ -2475,15 +2476,32 @@ fellow_busy_body_seg_alloc(struct fellow_busy *fbo,
fdr
=
fbr
->
reg
;
if
(
fdr
==
NULL
||
fbr
->
len
==
fdr
->
size
)
{
if
(
FC_INJ
)
return
(
0
);
memset
(
fbr
,
0
,
sizeof
*
fbr
);
assert
(
fbo
->
sz_estimate
>
fbo
->
sz_dskalloc
)
;
szc
=
fellow_busy_body_size_strategy
(
fbo
,
fbo
->
sz_dskalloc
)
;
reqs
=
&
fbo
->
bbrr
.
reqs
;
reg
=
buddy_off_extent_nil
;
fdr
=
fellow_busy_region_alloc
(
fbo
,
szc
.
sz
,
szc
.
cram
);
if
(
fdr
==
NULL
)
return
(
0
);
wait_dskalloc:
if
(
buddy_alloc_wait
(
reqs
))
{
reg
=
buddy_get_next_off_extent
(
reqs
);
buddy_alloc_wait_done
(
reqs
);
assert
(
reg
.
off
>=
0
);
}
if
(
reg
.
off
<
0
)
{
assert
(
fbo
->
sz_estimate
>
fbo
->
sz_dskalloc
);
szc
=
fellow_busy_body_size_strategy
(
fbo
,
fbo
->
sz_dskalloc
);
AN
(
buddy_req_extent
(
reqs
,
szc
.
sz
,
szc
.
cram
));
goto
wait_dskalloc
;
}
// Can only fail if reg.off < 0, which can't happen
fdr
=
fellow_busy_region_commit
(
fbo
,
reg
);
AN
(
fdr
);
fbr
->
reg
=
fdr
;
AZ
(
fbr
->
len
);
...
...
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