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
cea07a7b
Commit
cea07a7b
authored
Dec 17, 2023
by
Kent Overstreet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: vstruct_for_each() now declares loop iter
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
41b84fb4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
19 deletions
+9
-19
fs/bcachefs/journal.h
fs/bcachefs/journal.h
+0
-2
fs/bcachefs/journal_io.c
fs/bcachefs/journal_io.c
+1
-2
fs/bcachefs/recovery.c
fs/bcachefs/recovery.c
+3
-6
fs/bcachefs/super-io.c
fs/bcachefs/super-io.c
+0
-4
fs/bcachefs/vstructs.h
fs/bcachefs/vstructs.h
+5
-5
No files found.
fs/bcachefs/journal.h
View file @
cea07a7b
...
...
@@ -238,8 +238,6 @@ bch2_journal_add_entry(struct journal *j, struct journal_res *res,
static
inline
bool
journal_entry_empty
(
struct
jset
*
j
)
{
struct
jset_entry
*
i
;
if
(
j
->
seq
!=
j
->
last_seq
)
return
false
;
...
...
fs/bcachefs/journal_io.c
View file @
cea07a7b
...
...
@@ -783,7 +783,6 @@ void bch2_journal_entry_to_text(struct printbuf *out, struct bch_fs *c,
static
int
jset_validate_entries
(
struct
bch_fs
*
c
,
struct
jset
*
jset
,
enum
bkey_invalid_flags
flags
)
{
struct
jset_entry
*
entry
;
unsigned
version
=
le32_to_cpu
(
jset
->
version
);
int
ret
=
0
;
...
...
@@ -1723,7 +1722,7 @@ static CLOSURE_CALLBACK(do_journal_write)
static
int
bch2_journal_write_prep
(
struct
journal
*
j
,
struct
journal_buf
*
w
)
{
struct
bch_fs
*
c
=
container_of
(
j
,
struct
bch_fs
,
journal
);
struct
jset_entry
*
start
,
*
end
,
*
i
;
struct
jset_entry
*
start
,
*
end
;
struct
jset
*
jset
=
w
->
data
;
struct
journal_keys_to_wb
wb
=
{
NULL
};
unsigned
sectors
,
bytes
,
u64s
;
...
...
fs/bcachefs/recovery.c
View file @
cea07a7b
...
...
@@ -344,14 +344,11 @@ static int journal_replay_entry_early(struct bch_fs *c,
static
int
journal_replay_early
(
struct
bch_fs
*
c
,
struct
bch_sb_field_clean
*
clean
)
{
struct
jset_entry
*
entry
;
int
ret
;
if
(
clean
)
{
for
(
entry
=
clean
->
start
;
for
(
struct
jset_entry
*
entry
=
clean
->
start
;
entry
!=
vstruct_end
(
&
clean
->
field
);
entry
=
vstruct_next
(
entry
))
{
ret
=
journal_replay_entry_early
(
c
,
entry
);
int
ret
=
journal_replay_entry_early
(
c
,
entry
);
if
(
ret
)
return
ret
;
}
...
...
@@ -366,7 +363,7 @@ static int journal_replay_early(struct bch_fs *c,
continue
;
vstruct_for_each
(
&
i
->
j
,
entry
)
{
ret
=
journal_replay_entry_early
(
c
,
entry
);
int
ret
=
journal_replay_entry_early
(
c
,
entry
);
if
(
ret
)
return
ret
;
}
...
...
fs/bcachefs/super-io.c
View file @
cea07a7b
...
...
@@ -101,8 +101,6 @@ static int bch2_sb_field_validate(struct bch_sb *, struct bch_sb_field *,
struct
bch_sb_field
*
bch2_sb_field_get_id
(
struct
bch_sb
*
sb
,
enum
bch_sb_field_type
type
)
{
struct
bch_sb_field
*
f
;
/* XXX: need locking around superblock to access optional fields */
vstruct_for_each
(
sb
,
f
)
...
...
@@ -366,7 +364,6 @@ static int bch2_sb_validate(struct bch_sb_handle *disk_sb, struct printbuf *out,
int
rw
)
{
struct
bch_sb
*
sb
=
disk_sb
->
sb
;
struct
bch_sb_field
*
f
;
struct
bch_sb_field_members_v1
*
mi
;
enum
bch_opt_id
opt_id
;
u16
block_size
;
...
...
@@ -1250,7 +1247,6 @@ void bch2_sb_layout_to_text(struct printbuf *out, struct bch_sb_layout *l)
void
bch2_sb_to_text
(
struct
printbuf
*
out
,
struct
bch_sb
*
sb
,
bool
print_layout
,
unsigned
fields
)
{
struct
bch_sb_field
*
f
;
u64
fields_have
=
0
;
unsigned
nr_devices
=
0
;
...
...
fs/bcachefs/vstructs.h
View file @
cea07a7b
...
...
@@ -48,14 +48,14 @@
((void *) ((u64 *) (_s)->_data + __vstruct_u64s(_s)))
#define vstruct_for_each(_s, _i) \
for (
_i = (_s)->start;
\
for (
typeof(&(_s)->start[0]) _i = (_s)->start;
\
_i < vstruct_last(_s); \
_i = vstruct_next(_i))
#define vstruct_for_each_safe(_s, _i
, _t)
\
for (
_i = (_s)->start;
\
_i < vstruct_last(_s) && (_t = vstruct_next(_i), true); \
_i = _t)
#define vstruct_for_each_safe(_s, _i
)
\
for (
typeof(&(_s)->start[0]) _next, _i = (_s)->start;
\
_i < vstruct_last(_s) && (_
nex
t = vstruct_next(_i), true); \
_i = _
nex
t)
#define vstruct_idx(_s, _idx) \
((typeof(&(_s)->start[0])) ((_s)->_data + (_idx)))
...
...
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