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
cbb48e03
Unverified
Commit
cbb48e03
authored
Jul 17, 2024
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fellow_cache: add fellow_cache_seglist_capaity utility
parent
db0cdc22
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
fellow_cache.c
src/fellow_cache.c
+10
-3
No files found.
src/fellow_cache.c
View file @
cbb48e03
...
...
@@ -2480,6 +2480,15 @@ fellow_busy_fill_segmem(struct buddy_reqs *reqs, const void *priv)
AN
(
buddy_req_page
(
reqs
,
bits
,
0
));
}
static
size_t
fellow_cache_seglist_capacity
(
unsigned
bits
)
{
size_t
segs
=
fellow_cache_seglist_fit
((
size_t
)
1
<<
bits
);
if
(
segs
>
FELLOW_DISK_SEGLIST_MAX_SEGS
)
segs
=
FELLOW_DISK_SEGLIST_MAX_SEGS
;
return
(
segs
);
}
struct
fellow_cache_res
fellow_busy_obj_alloc
(
struct
fellow_cache
*
fc
,
struct
fellow_cache_obj
**
fcop
,
uintptr_t
*
priv2
,
...
...
@@ -2774,9 +2783,7 @@ fellow_busy_body_seglist_size_strategy(size_t segs, unsigned chunk_exponent)
else
if
(
bits
>
chunk_exponent
)
bits
=
chunk_exponent
;
segs
=
fellow_cache_seglist_fit
((
size_t
)
1
<<
bits
);
if
(
segs
>
FELLOW_DISK_SEGLIST_MAX_SEGS
)
segs
=
FELLOW_DISK_SEGLIST_MAX_SEGS
;
segs
=
fellow_cache_seglist_capacity
(
bits
);
assert
(
segs
<=
UINT16_MAX
);
return
((
uint16_t
)
segs
);
}
...
...
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