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
9d9d212e
Commit
9d9d212e
authored
Jun 28, 2024
by
Kent Overstreet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: bch2_extent_crc_unpacked_to_text()
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
5e3c2083
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
7 deletions
+16
-7
fs/bcachefs/extents.c
fs/bcachefs/extents.c
+14
-7
fs/bcachefs/extents.h
fs/bcachefs/extents.h
+2
-0
No files found.
fs/bcachefs/extents.c
View file @
9d9d212e
...
...
@@ -1034,6 +1034,18 @@ void bch2_extent_ptr_to_text(struct printbuf *out, struct bch_fs *c, const struc
--
out
->
atomic
;
}
void
bch2_extent_crc_unpacked_to_text
(
struct
printbuf
*
out
,
struct
bch_extent_crc_unpacked
*
crc
)
{
prt_printf
(
out
,
"crc: c_size %u size %u offset %u nonce %u csum "
,
crc
->
compressed_size
,
crc
->
uncompressed_size
,
crc
->
offset
,
crc
->
nonce
);
bch2_prt_csum_type
(
out
,
crc
->
csum_type
);
prt_printf
(
out
,
" %0llx:%0llx "
,
crc
->
csum
.
hi
,
crc
->
csum
.
lo
);
prt_str
(
out
,
" compress "
);
bch2_prt_compression_type
(
out
,
crc
->
compression_type
);
}
void
bch2_bkey_ptrs_to_text
(
struct
printbuf
*
out
,
struct
bch_fs
*
c
,
struct
bkey_s_c
k
)
{
...
...
@@ -1059,13 +1071,7 @@ void bch2_bkey_ptrs_to_text(struct printbuf *out, struct bch_fs *c,
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 "
,
crc
.
compressed_size
,
crc
.
uncompressed_size
,
crc
.
offset
,
crc
.
nonce
);
bch2_prt_csum_type
(
out
,
crc
.
csum_type
);
prt_str
(
out
,
" compress "
);
bch2_prt_compression_type
(
out
,
crc
.
compression_type
);
bch2_extent_crc_unpacked_to_text
(
out
,
&
crc
);
break
;
}
case
BCH_EXTENT_ENTRY_stripe_ptr
:
{
...
...
@@ -1096,6 +1102,7 @@ void bch2_bkey_ptrs_to_text(struct printbuf *out, struct bch_fs *c,
}
}
static
int
extent_ptr_invalid
(
struct
bch_fs
*
c
,
struct
bkey_s_c
k
,
enum
bch_validate_flags
flags
,
...
...
fs/bcachefs/extents.h
View file @
9d9d212e
...
...
@@ -212,6 +212,8 @@ static inline bool crc_is_encoded(struct bch_extent_crc_unpacked crc)
return
crc
.
csum_type
!=
BCH_CSUM_none
||
crc_is_compressed
(
crc
);
}
void
bch2_extent_crc_unpacked_to_text
(
struct
printbuf
*
,
struct
bch_extent_crc_unpacked
*
);
/* bkey_ptrs: generically over any key type that has ptrs */
struct
bkey_ptrs_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