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
ef435abd
Commit
ef435abd
authored
Oct 22, 2023
by
Kent Overstreet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: trivial extents.c refactoring
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
48f866e9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
fs/bcachefs/extents.c
fs/bcachefs/extents.c
+11
-11
No files found.
fs/bcachefs/extents.c
View file @
ef435abd
...
...
@@ -992,10 +992,6 @@ void bch2_bkey_ptrs_to_text(struct printbuf *out, struct bch_fs *c,
{
struct
bkey_ptrs_c
ptrs
=
bch2_bkey_ptrs_c
(
k
);
const
union
bch_extent_entry
*
entry
;
struct
bch_extent_crc_unpacked
crc
;
const
struct
bch_extent_ptr
*
ptr
;
const
struct
bch_extent_stripe_ptr
*
ec
;
struct
bch_dev
*
ca
;
bool
first
=
true
;
if
(
c
)
...
...
@@ -1006,9 +1002,9 @@ void bch2_bkey_ptrs_to_text(struct printbuf *out, struct bch_fs *c,
prt_printf
(
out
,
" "
);
switch
(
__extent_entry_type
(
entry
))
{
case
BCH_EXTENT_ENTRY_ptr
:
ptr
=
entry_to_ptr
(
entry
);
ca
=
c
&&
ptr
->
dev
<
c
->
sb
.
nr_devices
&&
c
->
devs
[
ptr
->
dev
]
case
BCH_EXTENT_ENTRY_ptr
:
{
const
struct
bch_extent_ptr
*
ptr
=
entry_to_ptr
(
entry
);
struct
bch_dev
*
ca
=
c
&&
ptr
->
dev
<
c
->
sb
.
nr_devices
&&
c
->
devs
[
ptr
->
dev
]
?
bch_dev_bkey_exists
(
c
,
ptr
->
dev
)
:
NULL
;
...
...
@@ -1030,10 +1026,12 @@ void bch2_bkey_ptrs_to_text(struct printbuf *out, struct bch_fs *c,
prt_printf
(
out
,
" stale"
);
}
break
;
}
case
BCH_EXTENT_ENTRY_crc32
:
case
BCH_EXTENT_ENTRY_crc64
:
case
BCH_EXTENT_ENTRY_crc128
:
crc
=
bch2_extent_crc_unpack
(
k
.
k
,
entry_to_crc
(
entry
));
case
BCH_EXTENT_ENTRY_crc128
:
{
struct
bch_extent_crc_unpacked
crc
=
bch2_extent_crc_unpack
(
k
.
k
,
entry_to_crc
(
entry
));
prt_printf
(
out
,
"crc: c_size %u size %u offset %u nonce %u csum %s compress %s"
,
crc
.
compressed_size
,
...
...
@@ -1042,12 +1040,14 @@ void bch2_bkey_ptrs_to_text(struct printbuf *out, struct bch_fs *c,
bch2_csum_types
[
crc
.
csum_type
],
bch2_compression_types
[
crc
.
compression_type
]);
break
;
case
BCH_EXTENT_ENTRY_stripe_ptr
:
ec
=
&
entry
->
stripe_ptr
;
}
case
BCH_EXTENT_ENTRY_stripe_ptr
:
{
const
struct
bch_extent_stripe_ptr
*
ec
=
&
entry
->
stripe_ptr
;
prt_printf
(
out
,
"ec: idx %llu block %u"
,
(
u64
)
ec
->
idx
,
ec
->
block
);
break
;
}
default:
prt_printf
(
out
,
"(invalid extent entry %.16llx)"
,
*
((
u64
*
)
entry
));
return
;
...
...
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