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
f7c3dc26
Commit
f7c3dc26
authored
Apr 25, 2024
by
Kent Overstreet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: btree node scan now fills in sectors_written
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
ae927653
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
fs/bcachefs/btree_node_scan.c
fs/bcachefs/btree_node_scan.c
+5
-2
fs/bcachefs/btree_node_scan_types.h
fs/bcachefs/btree_node_scan_types.h
+1
-0
No files found.
fs/bcachefs/btree_node_scan.c
View file @
f7c3dc26
...
...
@@ -57,13 +57,14 @@ static void found_btree_node_to_key(struct bkey_i *k, const struct found_btree_n
bp
->
v
.
seq
=
cpu_to_le64
(
f
->
cookie
);
bp
->
v
.
sectors_written
=
0
;
bp
->
v
.
flags
=
0
;
bp
->
v
.
sectors_written
=
cpu_to_le16
(
f
->
sectors_written
);
bp
->
v
.
min_key
=
f
->
min_key
;
SET_BTREE_PTR_RANGE_UPDATED
(
&
bp
->
v
,
f
->
range_updated
);
memcpy
(
bp
->
v
.
start
,
f
->
ptrs
,
sizeof
(
struct
bch_extent_ptr
)
*
f
->
nr_ptrs
);
}
static
bool
found_btree_node_is_readable
(
struct
btree_trans
*
trans
,
const
struct
found_btree_node
*
f
)
struct
found_btree_node
*
f
)
{
struct
{
__BKEY_PADDED
(
k
,
BKEY_BTREE_PTR_VAL_U64s_MAX
);
}
k
;
...
...
@@ -71,8 +72,10 @@ static bool found_btree_node_is_readable(struct btree_trans *trans,
struct
btree
*
b
=
bch2_btree_node_get_noiter
(
trans
,
&
k
.
k
,
f
->
btree_id
,
f
->
level
,
false
);
bool
ret
=
!
IS_ERR_OR_NULL
(
b
);
if
(
ret
)
if
(
ret
)
{
f
->
sectors_written
=
b
->
written
;
six_unlock_read
(
&
b
->
c
.
lock
);
}
/*
* We might update this node's range; if that happens, we need the node
...
...
fs/bcachefs/btree_node_scan_types.h
View file @
f7c3dc26
...
...
@@ -9,6 +9,7 @@ struct found_btree_node {
bool
overwritten
:
1
;
u8
btree_id
;
u8
level
;
unsigned
sectors_written
;
u32
seq
;
u64
cookie
;
...
...
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