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
7adfa514
Unverified
Commit
7adfa514
authored
Dec 21, 2023
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fellow_busy: Simplity ..._body_size_strategy()
parent
a07c842c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
fellow_cache.c
src/fellow_cache.c
+10
-8
No files found.
src/fellow_cache.c
View file @
7adfa514
...
@@ -2404,19 +2404,21 @@ struct szc {
...
@@ -2404,19 +2404,21 @@ struct szc {
};
};
/*
/*
* Return a size to allocate next for the object body,
* Return a size to allocate next for the object body
* given that already bytes are alocated
*/
*/
static
struct
szc
static
struct
szc
fellow_busy_body_size_strategy
(
const
struct
fellow_busy
*
fbo
,
size_t
already
)
fellow_busy_body_size_strategy
(
const
struct
fellow_busy
*
fbo
)
{
{
unsigned
chunkbits
;
unsigned
chunkbits
;
struct
szc
szc
;
struct
szc
szc
=
{
0
,
0
};
if
(
fbo
->
sz_estimate
<=
fbo
->
sz_dskalloc
)
return
(
szc
);
chunkbits
=
fbo
->
fc
->
tune
->
chunk_exponent
;
chunkbits
=
fbo
->
fc
->
tune
->
chunk_exponent
;
szc
.
cram
=
fbo
->
fc
->
tune
->
cram
;
szc
.
cram
=
fbo
->
fc
->
tune
->
cram
;
assert
(
fbo
->
sz_estimate
>
already
);
assert
(
fbo
->
sz_estimate
>
fbo
->
sz_dskalloc
);
szc
.
sz
=
fbo
->
sz_estimate
-
fbo
->
sz_dskalloc
;
szc
.
sz
=
fbo
->
sz_estimate
-
fbo
->
sz_dskalloc
;
// out of regions: no cram
// out of regions: no cram
...
@@ -2492,9 +2494,9 @@ fellow_busy_body_seg_alloc(struct fellow_busy *fbo,
...
@@ -2492,9 +2494,9 @@ fellow_busy_body_seg_alloc(struct fellow_busy *fbo,
}
}
if
(
reg
.
off
<
0
)
{
if
(
reg
.
off
<
0
)
{
assert
(
fbo
->
sz_estimate
>
fbo
->
sz_dskalloc
);
szc
=
fellow_busy_body_size_strategy
(
fbo
);
szc
=
fellow_busy_body_size_strategy
(
fbo
,
// must return a size, or sz_estimate is wrong
fbo
->
sz_dskalloc
);
AN
(
szc
.
sz
);
AN
(
buddy_req_extent
(
reqs
,
szc
.
sz
,
szc
.
cram
));
AN
(
buddy_req_extent
(
reqs
,
szc
.
sz
,
szc
.
cram
));
goto
wait_dskalloc
;
goto
wait_dskalloc
;
}
}
...
...
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