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
0c07b475
Unverified
Commit
0c07b475
authored
Oct 23, 2023
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Trivial refactor
Ref #28
parent
2d619a45
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
8 deletions
+16
-8
fellow_log.c
src/fellow_log.c
+16
-8
No files found.
src/fellow_log.c
View file @
0c07b475
...
...
@@ -2187,6 +2187,19 @@ logbuffer_alloc_some(const struct fellow_logbuffer *lbuf,
}
}
static
void
logbuffer_alloc
(
struct
fellow_logbuffer
*
lbuf
)
{
CHECK_OBJ_NOTNULL
(
lbuf
,
FELLOW_LOGBUFFER_MAGIC
);
if
(
lbuf
->
head
.
off
==
0
)
logbuffer_alloc_some
(
lbuf
,
&
lbuf
->
head
,
1
);
if
(
lbuf
->
n
>
0
)
logbuffer_alloc_some
(
lbuf
,
lbuf
->
arr
,
lbuf
->
n
);
if
(
lbuf
->
active
.
off
==
0
)
logbuffer_alloc_some
(
lbuf
,
&
lbuf
->
active
,
1
);
}
static
void
logbuffer_ref
(
struct
fellow_fd
*
ffd
,
const
struct
fellow_logbuffer
*
lbuf
)
{
...
...
@@ -2413,14 +2426,9 @@ logbuffer_flush(struct fellow_fd *ffd,
assert
(
lbuf
->
active
.
block
!=
lbuf
->
head
.
block
);
/* alloc blocks for all lofbuffer blocks */
if
(
cap
(
can
,
LBUF_CAN_FLUSH
))
{
if
(
lbuf
->
head
.
off
==
0
)
logbuffer_alloc_some
(
lbuf
,
&
lbuf
->
head
,
1
);
if
(
lbuf
->
n
>
0
)
logbuffer_alloc_some
(
lbuf
,
lbuf
->
arr
,
lbuf
->
n
);
if
(
lbuf
->
active
.
off
==
0
)
logbuffer_alloc_some
(
lbuf
,
&
lbuf
->
active
,
1
);
}
else
{
if
(
cap
(
can
,
LBUF_CAN_FLUSH
))
logbuffer_alloc
(
lbuf
);
else
{
/* we transition to LBUF_MEM when logregion is full */
assert
(
cap
(
can
,
LBUF_CAN_LOGREG
));
assert
(
lbuf
->
state
==
LBUF_LOGREG
);
...
...
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