Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
478259b7
Commit
478259b7
authored
Apr 05, 2019
by
Kent Overstreet
Committed by
Kent Overstreet
Oct 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: delete duplicated code
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
330581f1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
39 deletions
+16
-39
fs/bcachefs/journal.c
fs/bcachefs/journal.c
+0
-13
fs/bcachefs/journal.h
fs/bcachefs/journal.h
+13
-0
fs/bcachefs/recovery.c
fs/bcachefs/recovery.c
+3
-26
No files found.
fs/bcachefs/journal.c
View file @
478259b7
...
...
@@ -55,19 +55,6 @@ static void bch2_journal_buf_init(struct journal *j)
buf
->
data
->
u64s
=
0
;
}
static
inline
bool
journal_entry_empty
(
struct
jset
*
j
)
{
struct
jset_entry
*
i
;
if
(
j
->
seq
!=
j
->
last_seq
)
return
false
;
vstruct_for_each
(
j
,
i
)
if
(
i
->
type
||
i
->
u64s
)
return
false
;
return
true
;
}
void
bch2_journal_halt
(
struct
journal
*
j
)
{
union
journal_res_state
old
,
new
;
...
...
fs/bcachefs/journal.h
View file @
478259b7
...
...
@@ -231,6 +231,19 @@ static inline void bch2_journal_add_keys(struct journal *j, struct journal_res *
id
,
0
,
k
,
k
->
k
.
u64s
);
}
static
inline
bool
journal_entry_empty
(
struct
jset
*
j
)
{
struct
jset_entry
*
i
;
if
(
j
->
seq
!=
j
->
last_seq
)
return
false
;
vstruct_for_each
(
j
,
i
)
if
(
i
->
type
==
BCH_JSET_ENTRY_btree_keys
&&
i
->
u64s
)
return
false
;
return
true
;
}
void
__bch2_journal_buf_put
(
struct
journal
*
,
bool
);
static
inline
void
bch2_journal_buf_put
(
struct
journal
*
j
,
unsigned
idx
,
...
...
fs/bcachefs/recovery.c
View file @
478259b7
...
...
@@ -322,32 +322,9 @@ static int read_btree_roots(struct bch_fs *c)
static
bool
journal_empty
(
struct
list_head
*
journal
)
{
struct
journal_replay
*
i
;
struct
jset_entry
*
entry
;
if
(
list_empty
(
journal
))
return
true
;
i
=
list_last_entry
(
journal
,
struct
journal_replay
,
list
);
if
(
i
->
j
.
last_seq
!=
i
->
j
.
seq
)
return
false
;
list_for_each_entry
(
i
,
journal
,
list
)
{
vstruct_for_each
(
&
i
->
j
,
entry
)
{
if
(
entry
->
type
==
BCH_JSET_ENTRY_btree_root
||
entry
->
type
==
BCH_JSET_ENTRY_usage
||
entry
->
type
==
BCH_JSET_ENTRY_data_usage
)
continue
;
if
(
entry
->
type
==
BCH_JSET_ENTRY_btree_keys
&&
!
entry
->
u64s
)
continue
;
return
false
;
}
}
return
true
;
return
list_empty
(
journal
)
||
journal_entry_empty
(
&
list_last_entry
(
journal
,
struct
journal_replay
,
list
)
->
j
);
}
int
bch2_fs_recovery
(
struct
bch_fs
*
c
)
...
...
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