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
ae984685
Unverified
Commit
ae984685
authored
Jan 19, 2024
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fellow_cache: Use new fdo pointer (but no change yet)
parent
82b60d1f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
8 deletions
+15
-8
fellow_cache.c
src/fellow_cache.c
+15
-8
No files found.
src/fellow_cache.c
View file @
ae984685
...
...
@@ -347,7 +347,6 @@ static inline uint16_t \
SEGLIST_FIT_FUNC
(
disk
)
//struct fellow_disk_obj;
struct
fellow_cache_obj
;
struct
fellow_cache_seg
{
uint16_t
magic
;
...
...
@@ -1090,10 +1089,12 @@ fellow_busy_io_submit(struct fellow_busy_io *fbio)
static
inline
struct
fellow_disk_obj
*
fellow_disk_obj
(
const
struct
fellow_cache_seg
*
fcs
)
{
AN
(
fcs
);
AN
(
fcs
->
alloc
.
ptr
);
CHECK_OBJ_NOTNULL
(
fcs
,
FELLOW_CACHE_SEG_MAGIC
);
assert
(
FCOS_HIGH
(
fcs
->
state
)
==
FCO_HIGH
);
return
(
fcs
->
alloc
.
ptr
);
if
(
fcs
->
alloc
.
ptr
!=
NULL
)
assert
(
fcs
->
alloc
.
ptr
==
fcs
->
u
.
fco_fdo
);
return
(
fcs
->
u
.
fco_fdo
);
}
static
const
char
*
...
...
@@ -1201,16 +1202,18 @@ fellow_disk_obj_trim(const struct fellow_cache *fc,
mem
=
buddy_alloc1_ptr_extent_wait
(
fc
->
membuddy
,
FEP_SPCPRI
,
trim_sz
,
0
);
if
(
mem
.
ptr
)
{
memcpy
(
mem
.
ptr
,
f
cs
->
alloc
.
ptr
,
trim_sz
);
memcpy
(
mem
.
ptr
,
f
do
,
trim_sz
);
buddy_return1_ptr_extent
(
fc
->
membuddy
,
&
fcs
->
alloc
);
fcs
->
alloc
=
mem
;
fcs
->
u
.
fco_fdo
=
mem
.
ptr
;
break
;
}
}
/* FALLTHROUGH */
case
FCO_WRITING
:
buddy_trim1_ptr_extent
(
fc
->
membuddy
,
&
fcs
->
alloc
,
trim_sz
);
assert
(
fdo
==
fcs
->
alloc
.
ptr
);
break
;
default:
WRONG
(
"fcs->state to call fellow_disk_obj_trim()"
);
...
...
@@ -1424,8 +1427,11 @@ assert_cache_seg_consistency(const struct fellow_cache_seg *fcs)
AN(fcs->alloc.size); \
} while(0)
#define FCOA_MEM do { \
AN(fcs->alloc.ptr); \
/* can be NULL for embedded fdo */
\
if (fcs->alloc.ptr != NULL) { \
AN(fcs->alloc.size); \
assert(fcs->alloc.ptr == fcs->u.fco_fdo); \
} \
} while(0)
#define FDSA_NULL AZ(fcs->disk_seg)
#define FDSA_MAY CHECK_OBJ_ORNULL(fcs->disk_seg, FELLOW_DISK_SEG_MAGIC)
...
...
@@ -2177,6 +2183,7 @@ fellow_cache_obj_new(
fellow_cache_seg_init
(
fcs
,
fco
,
FCO_INIT
);
fcs
->
alloc
=
fdo_mem
;
fcs
->
u
.
fco_fdo
=
fdo
;
return
(
FCR_OK
(
fco
));
err
:
...
...
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