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
4eb3877e
Commit
4eb3877e
authored
Dec 17, 2023
by
Kent Overstreet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: fsck -> bch2_trans_run()
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
cea07a7b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
43 deletions
+34
-43
fs/bcachefs/fsck.c
fs/bcachefs/fsck.c
+34
-43
No files found.
fs/bcachefs/fsck.c
View file @
4eb3877e
...
@@ -973,21 +973,19 @@ static int check_inode(struct btree_trans *trans,
...
@@ -973,21 +973,19 @@ static int check_inode(struct btree_trans *trans,
int
bch2_check_inodes
(
struct
bch_fs
*
c
)
int
bch2_check_inodes
(
struct
bch_fs
*
c
)
{
{
bool
full
=
c
->
opts
.
fsck
;
bool
full
=
c
->
opts
.
fsck
;
struct
btree_trans
*
trans
=
bch2_trans_get
(
c
);
struct
bch_inode_unpacked
prev
=
{
0
};
struct
bch_inode_unpacked
prev
=
{
0
};
struct
snapshots_seen
s
;
struct
snapshots_seen
s
;
int
ret
;
snapshots_seen_init
(
&
s
);
snapshots_seen_init
(
&
s
);
ret
=
for_each_btree_key_commit
(
trans
,
iter
,
BTREE_ID_inodes
,
int
ret
=
bch2_trans_run
(
c
,
POS_MIN
,
for_each_btree_key_commit
(
trans
,
iter
,
BTREE_ID_inodes
,
BTREE_ITER_PREFETCH
|
BTREE_ITER_ALL_SNAPSHOTS
,
k
,
POS_MIN
,
NULL
,
NULL
,
BCH_TRANS_COMMIT_no_enospc
,
BTREE_ITER_PREFETCH
|
BTREE_ITER_ALL_SNAPSHOTS
,
k
,
check_inode
(
trans
,
&
iter
,
k
,
&
prev
,
&
s
,
full
));
NULL
,
NULL
,
BCH_TRANS_COMMIT_no_enospc
,
check_inode
(
trans
,
&
iter
,
k
,
&
prev
,
&
s
,
full
)));
snapshots_seen_exit
(
&
s
);
snapshots_seen_exit
(
&
s
);
bch2_trans_put
(
trans
);
bch_err_fn
(
c
,
ret
);
bch_err_fn
(
c
,
ret
);
return
ret
;
return
ret
;
}
}
...
@@ -1417,30 +1415,28 @@ int bch2_check_extents(struct bch_fs *c)
...
@@ -1417,30 +1415,28 @@ int bch2_check_extents(struct bch_fs *c)
{
{
struct
inode_walker
w
=
inode_walker_init
();
struct
inode_walker
w
=
inode_walker_init
();
struct
snapshots_seen
s
;
struct
snapshots_seen
s
;
struct
btree_trans
*
trans
=
bch2_trans_get
(
c
);
struct
extent_ends
extent_ends
;
struct
extent_ends
extent_ends
;
struct
disk_reservation
res
=
{
0
};
struct
disk_reservation
res
=
{
0
};
int
ret
=
0
;
snapshots_seen_init
(
&
s
);
snapshots_seen_init
(
&
s
);
extent_ends_init
(
&
extent_ends
);
extent_ends_init
(
&
extent_ends
);
ret
=
for_each_btree_key_commit
(
trans
,
iter
,
BTREE_ID_extents
,
int
ret
=
bch2_trans_run
(
c
,
POS
(
BCACHEFS_ROOT_INO
,
0
),
for_each_btree_key_commit
(
trans
,
iter
,
BTREE_ID_extents
,
BTREE_ITER_PREFETCH
|
BTREE_ITER_ALL_SNAPSHOTS
,
k
,
POS
(
BCACHEFS_ROOT_INO
,
0
),
&
res
,
NULL
,
BTREE_ITER_PREFETCH
|
BTREE_ITER_ALL_SNAPSHOTS
,
k
,
BCH_TRANS_COMMIT_no_enospc
,
({
&
res
,
NULL
,
bch2_disk_reservation_put
(
c
,
&
res
);
BCH_TRANS_COMMIT_no_enospc
,
({
check_extent
(
trans
,
&
iter
,
k
,
&
w
,
&
s
,
&
extent_ends
)
?:
bch2_disk_reservation_put
(
c
,
&
res
);
check_extent_overbig
(
trans
,
&
iter
,
k
);
check_extent
(
trans
,
&
iter
,
k
,
&
w
,
&
s
,
&
extent_ends
)
?:
}))
?:
check_extent_overbig
(
trans
,
&
iter
,
k
);
check_i_sectors
(
trans
,
&
w
);
}))
?:
check_i_sectors
(
trans
,
&
w
));
bch2_disk_reservation_put
(
c
,
&
res
);
bch2_disk_reservation_put
(
c
,
&
res
);
extent_ends_exit
(
&
extent_ends
);
extent_ends_exit
(
&
extent_ends
);
inode_walker_exit
(
&
w
);
inode_walker_exit
(
&
w
);
snapshots_seen_exit
(
&
s
);
snapshots_seen_exit
(
&
s
);
bch2_trans_put
(
trans
);
bch_err_fn
(
c
,
ret
);
bch_err_fn
(
c
,
ret
);
return
ret
;
return
ret
;
...
@@ -1448,22 +1444,19 @@ int bch2_check_extents(struct bch_fs *c)
...
@@ -1448,22 +1444,19 @@ int bch2_check_extents(struct bch_fs *c)
int
bch2_check_indirect_extents
(
struct
bch_fs
*
c
)
int
bch2_check_indirect_extents
(
struct
bch_fs
*
c
)
{
{
struct
btree_trans
*
trans
=
bch2_trans_get
(
c
);
struct
disk_reservation
res
=
{
0
};
struct
disk_reservation
res
=
{
0
};
int
ret
=
0
;
ret
=
for_each_btree_key_commit
(
trans
,
iter
,
BTREE_ID_reflink
,
int
ret
=
bch2_trans_run
(
c
,
POS_MIN
,
for_each_btree_key_commit
(
trans
,
iter
,
BTREE_ID_reflink
,
BTREE_ITER_PREFETCH
,
k
,
POS_MIN
,
&
res
,
NULL
,
BTREE_ITER_PREFETCH
,
k
,
BCH_TRANS_COMMIT_no_enospc
,
({
&
res
,
NULL
,
bch2_disk_reservation_put
(
c
,
&
res
);
BCH_TRANS_COMMIT_no_enospc
,
({
check_extent_overbig
(
trans
,
&
iter
,
k
);
bch2_disk_reservation_put
(
c
,
&
res
);
}));
check_extent_overbig
(
trans
,
&
iter
,
k
);
})));
bch2_disk_reservation_put
(
c
,
&
res
);
bch2_disk_reservation_put
(
c
,
&
res
);
bch2_trans_put
(
trans
);
bch_err_fn
(
c
,
ret
);
bch_err_fn
(
c
,
ret
);
return
ret
;
return
ret
;
}
}
...
@@ -1816,20 +1809,18 @@ int bch2_check_dirents(struct bch_fs *c)
...
@@ -1816,20 +1809,18 @@ int bch2_check_dirents(struct bch_fs *c)
struct
inode_walker
target
=
inode_walker_init
();
struct
inode_walker
target
=
inode_walker_init
();
struct
snapshots_seen
s
;
struct
snapshots_seen
s
;
struct
bch_hash_info
hash_info
;
struct
bch_hash_info
hash_info
;
struct
btree_trans
*
trans
=
bch2_trans_get
(
c
);
int
ret
=
0
;
snapshots_seen_init
(
&
s
);
snapshots_seen_init
(
&
s
);
ret
=
for_each_btree_key_commit
(
trans
,
iter
,
BTREE_ID_dirents
,
int
ret
=
bch2_trans_run
(
c
,
POS
(
BCACHEFS_ROOT_INO
,
0
),
for_each_btree_key_commit
(
trans
,
iter
,
BTREE_ID_dirents
,
BTREE_ITER_PREFETCH
|
BTREE_ITER_ALL_SNAPSHOTS
,
POS
(
BCACHEFS_ROOT_INO
,
0
),
k
,
BTREE_ITER_PREFETCH
|
BTREE_ITER_ALL_SNAPSHOTS
,
NULL
,
NULL
,
k
,
BCH_TRANS_COMMIT_no_enospc
,
NULL
,
NULL
,
check_dirent
(
trans
,
&
iter
,
k
,
&
hash_info
,
&
dir
,
&
target
,
&
s
));
BCH_TRANS_COMMIT_no_enospc
,
check_dirent
(
trans
,
&
iter
,
k
,
&
hash_info
,
&
dir
,
&
target
,
&
s
)));
bch2_trans_put
(
trans
);
snapshots_seen_exit
(
&
s
);
snapshots_seen_exit
(
&
s
);
inode_walker_exit
(
&
dir
);
inode_walker_exit
(
&
dir
);
inode_walker_exit
(
&
target
);
inode_walker_exit
(
&
target
);
...
...
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