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
c40f8bcd
Unverified
Commit
c40f8bcd
authored
Jul 21, 2023
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Trivial refactor: move code. View with diff -b
parent
fc1af457
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
33 deletions
+41
-33
fellow_storage.c
src/fellow_storage.c
+41
-33
No files found.
src/fellow_storage.c
View file @
c40f8bcd
...
@@ -1784,6 +1784,45 @@ sfe_objnew(struct sfe_resurrect_priv *sfer, struct worker *wrk,
...
@@ -1784,6 +1784,45 @@ sfe_objnew(struct sfe_resurrect_priv *sfer, struct worker *wrk,
return
(
oc
);
return
(
oc
);
}
}
static
int
sfe_resurrect_ban
(
struct
sfe_resurrect_priv
*
sfer
,
const
struct
fellow_dle
*
e
)
{
struct
sfe_ban_t
ban_t
;
assert
(
DLE_TYPE
(
e
->
type
)
==
DLE_T_BAN_REG
||
DLE_TYPE
(
e
->
type
)
==
DLE_T_BAN_IMM
);
sfer
->
has_bans
=
1
;
switch
(
DLE_TYPE
(
e
->
type
))
{
case
DLE_T_BAN_REG
:
ban_t
=
sfe_ban_reg
(
sfer
,
e
);
break
;
case
DLE_T_BAN_IMM
:
ban_t
=
sfe_ban_imm
(
sfer
,
e
);
break
;
default:
WRONG
(
"dle type for ban resurrect"
);
}
AN
(
ban_t
.
earliest
);
AN
(
ban_t
.
latest
);
switch
(
DLE_OP
(
e
->
type
))
{
case
DLE_OP_ADD
:
// single ban
festash_work_one
(
sfer
->
fet
,
ban_t
.
latest
);
break
;
case
DLE_OP_CHG
:
// ban export
AZ
(
sfer
->
ban_exp_t
.
earliest
);
AZ
(
sfer
->
ban_exp_t
.
latest
);
sfer
->
ban_exp_t
=
ban_t
;
festash_top_work
(
sfer
->
fet
,
sfer
->
has_bans
);
break
;
default:
WRONG
(
"dle op for ban resurrect"
);
}
//fprintf(stdout, "loaded ban %f\n", ban_t);
return
(
0
);
}
/*
/*
* create vampire objects for objects in storage
* create vampire objects for objects in storage
...
@@ -1794,7 +1833,6 @@ static int
...
@@ -1794,7 +1833,6 @@ static int
sfe_resurrect
(
void
*
priv
,
const
struct
fellow_dle
*
e
)
sfe_resurrect
(
void
*
priv
,
const
struct
fellow_dle
*
e
)
{
{
struct
sfe_resurrect_priv
*
sfer
;
struct
sfe_resurrect_priv
*
sfer
;
struct
sfe_ban_t
ban_t
;
struct
objcore
*
oc
;
struct
objcore
*
oc
;
struct
ban
*
ban
;
struct
ban
*
ban
;
vtim_real
t
;
vtim_real
t
;
...
@@ -1809,38 +1847,8 @@ sfe_resurrect(void *priv, const struct fellow_dle *e)
...
@@ -1809,38 +1847,8 @@ sfe_resurrect(void *priv, const struct fellow_dle *e)
}
}
if
(
DLE_TYPE
(
e
->
type
)
==
DLE_T_BAN_REG
||
if
(
DLE_TYPE
(
e
->
type
)
==
DLE_T_BAN_REG
||
DLE_TYPE
(
e
->
type
)
==
DLE_T_BAN_IMM
)
{
DLE_TYPE
(
e
->
type
)
==
DLE_T_BAN_IMM
)
sfer
->
has_bans
=
1
;
return
(
sfe_resurrect_ban
(
sfer
,
e
));
switch
(
DLE_TYPE
(
e
->
type
))
{
case
DLE_T_BAN_REG
:
ban_t
=
sfe_ban_reg
(
sfer
,
e
);
break
;
case
DLE_T_BAN_IMM
:
ban_t
=
sfe_ban_imm
(
sfer
,
e
);
break
;
default:
WRONG
(
"dle type for ban resurrect"
);
}
AN
(
ban_t
.
earliest
);
AN
(
ban_t
.
latest
);
switch
(
DLE_OP
(
e
->
type
))
{
case
DLE_OP_ADD
:
// single ban
festash_work_one
(
sfer
->
fet
,
ban_t
.
latest
);
break
;
case
DLE_OP_CHG
:
// ban export
AZ
(
sfer
->
ban_exp_t
.
earliest
);
AZ
(
sfer
->
ban_exp_t
.
latest
);
sfer
->
ban_exp_t
=
ban_t
;
festash_top_work
(
sfer
->
fet
,
sfer
->
has_bans
);
break
;
default:
WRONG
(
"dle op for ban resurrect"
);
}
//fprintf(stdout, "loaded ban %f\n", ban_t);
return
(
0
);
}
if
(
!
sfe_check
(
sfer
,
e
))
if
(
!
sfe_check
(
sfer
,
e
))
return
(
0
);
return
(
0
);
...
...
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