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
1902b35a
Unverified
Commit
1902b35a
authored
Oct 23, 2023
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add buddy_get_next_off_*
parent
0c07b475
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
buddy.h
src/buddy.h
+23
-0
No files found.
src/buddy.h
View file @
1902b35a
...
...
@@ -298,6 +298,7 @@ struct i_wait {
#define I_WAIT_MAGIC 0x7f6303bc
uint8_t
alloced
;
// how many of n
uint8_t
finid
;
uint8_t
next
;
enum
i_wait_state
state
;
VTAILQ_ENTRY
(
buddy_reqs
)
list
;
pthread_mutex_t
wait_mtx
;
...
...
@@ -524,6 +525,7 @@ BUDDYF(take_ptr_extent)(buddy_t *buddy, const struct buddy_ptr_extent *rs,
.magic = I_WAIT_MAGIC, \
.alloced = 0, \
.finid = 0, \
.next = 0, \
.state = IW_ARMED, \
.list = { NULL }, \
.wait_mtx = PTHREAD_MUTEX_INITIALIZER, \
...
...
@@ -826,6 +828,17 @@ buddy_get_off_extent(const struct buddy_reqs *reqs, uint8_t n)
return
(
_buddy_get_off_extent
(
reqs
,
n
));
}
static
inline
struct
buddy_off_extent
buddy_get_next_off_extent
(
struct
buddy_reqs
*
reqs
)
{
CHECK_OBJ_NOTNULL
(
reqs
,
BUDDY_REQS_MAGIC
);
if
(
reqs
->
i_wait
.
next
==
reqs
->
i_wait
.
finid
)
return
(
buddy_off_extent_nil
);
return
(
buddy_get_off_extent
(
reqs
,
reqs
->
i_wait
.
next
++
));
}
#endif
static
inline
struct
buddy_ptr_extent
...
...
@@ -861,6 +874,16 @@ buddy_get_off_page(const struct buddy_reqs *reqs, uint8_t n)
{
return
(
_buddy_get_off_page
(
reqs
,
n
));
}
static
inline
struct
buddy_off_page
buddy_get_next_off_page
(
struct
buddy_reqs
*
reqs
)
{
CHECK_OBJ_NOTNULL
(
reqs
,
BUDDY_REQS_MAGIC
);
if
(
reqs
->
i_wait
.
next
==
reqs
->
i_wait
.
finid
)
return
(
buddy_off_page_nil
);
return
(
buddy_get_off_page
(
reqs
,
reqs
->
i_wait
.
next
++
));
}
#endif
static
inline
struct
buddy_ptr_page
...
...
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