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
07f49056
Unverified
Commit
07f49056
authored
Dec 18, 2023
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fellow_busy: Change fellow_busy_seg_memalloc() signature and pull in cram logic
parent
a64785e8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
fellow_cache.c
src/fellow_cache.c
+10
-7
No files found.
src/fellow_cache.c
View file @
07f49056
...
...
@@ -4238,7 +4238,7 @@ fellow_busy_body_seg_next(struct fellow_busy *fbo)
*
* used for body and auxattr
*/
static
size_t
fellow_busy_seg_memalloc
(
buddy_t
*
membuddy
,
static
size_t
fellow_busy_seg_memalloc
(
const
struct
fellow_busy
*
fbo
,
struct
fellow_cache_seg
*
fcs
,
int8_t
cram
)
{
struct
fellow_disk_seg
*
fds
;
...
...
@@ -4257,8 +4257,12 @@ static size_t fellow_busy_seg_memalloc(buddy_t *membuddy,
if
(
FC_INJ
)
return
(
0
);
fcs
->
alloc
=
buddy_alloc1_ptr_extent_wait
(
membuddy
,
FEP_SPC
,
fds
->
seg
.
size
,
cram
);
if
(
cram
!=
0
)
{
cram
=
buddy_cramlimit_bits
(
fds
->
seg
.
size
,
fbo
->
fc
->
tune
->
cram
,
MIN_FELLOW_BITS
);
}
fcs
->
alloc
=
buddy_alloc1_ptr_extent_wait
(
fbo
->
fc
->
membuddy
,
FEP_SPC
,
fds
->
seg
.
size
,
cram
);
if
(
fcs
->
alloc
.
ptr
==
NULL
)
return
(
0
);
...
...
@@ -4303,7 +4307,7 @@ fellow_busy_seg_alloc(struct fellow_busy *fbo,
if
(
fdr
==
NULL
)
return
(
0
);
fds
->
seg
=
*
fdr
;
if
(
fellow_busy_seg_memalloc
(
fbo
->
fc
->
membuddy
,
fcs
,
0
)
==
0
)
if
(
fellow_busy_seg_memalloc
(
fbo
,
fcs
,
0
)
==
0
)
// we do not need to free because we use the busy region
return
(
0
);
return
(
1
);
...
...
@@ -4409,8 +4413,7 @@ fellow_busy_obj_getspace(struct fellow_busy *fbo, size_t *sz, uint8_t **ptr)
goto
out
;
}
spc
=
fellow_busy_seg_memalloc
(
fbo
->
fc
->
membuddy
,
fcs
,
buddy_cramlimit_bits
(
spc
,
fbo
->
fc
->
tune
->
cram
,
MIN_FELLOW_BITS
));
spc
=
fellow_busy_seg_memalloc
(
fbo
,
fcs
,
fbo
->
fc
->
tune
->
cram
);
if
(
spc
==
0
)
{
fellow_busy_body_seg_return
(
fbo
,
fcs
->
disk_seg
);
fcr
=
FCR_ALLOCFAIL
(
"body memory seg alloc"
);
...
...
@@ -6325,7 +6328,7 @@ t_cache(const char *fn, unsigned chksum)
AN
(
fbo
->
body_seg
);
assert
(
fbo
->
body_seg
->
state
==
FCS_DISK
);
fbo
->
body_seg
->
state
=
FCS_USABLE
;
AN
(
fellow_busy_seg_memalloc
(
membuddy
,
fbo
->
body_seg
,
0
));
AN
(
fellow_busy_seg_memalloc
(
fbo
,
fbo
->
body_seg
,
0
));
assert
(
fbo
->
nregion
==
FCO_MAX_REGIONS
);
test_bocdone
(
fbo
,
TRUST_ME
(
hash
),
1
);
...
...
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