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
abce30b7
Commit
abce30b7
authored
Sep 30, 2018
by
Kent Overstreet
Committed by
Kent Overstreet
Oct 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: BCH_EXTENT_ENTRY_TYPES()
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
71c9e0ba
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
18 deletions
+19
-18
fs/bcachefs/bcachefs_format.h
fs/bcachefs/bcachefs_format.h
+14
-10
fs/bcachefs/extents.h
fs/bcachefs/extents.h
+5
-8
No files found.
fs/bcachefs/bcachefs_format.h
View file @
abce30b7
...
...
@@ -461,15 +461,19 @@ enum bch_compression_type {
BCH_COMPRESSION_NR
=
5
,
};
#define BCH_EXTENT_ENTRY_TYPES() \
x(ptr, 0) \
x(crc32, 1) \
x(crc64, 2) \
x(crc128, 3)
#define BCH_EXTENT_ENTRY_MAX 4
enum
bch_extent_entry_type
{
BCH_EXTENT_ENTRY_ptr
=
0
,
BCH_EXTENT_ENTRY_crc32
=
1
,
BCH_EXTENT_ENTRY_crc64
=
2
,
BCH_EXTENT_ENTRY_crc128
=
3
,
#define x(f, n) BCH_EXTENT_ENTRY_##f = n,
BCH_EXTENT_ENTRY_TYPES
()
#undef x
};
#define BCH_EXTENT_ENTRY_MAX 4
/* Compressed/uncompressed size are stored biased by 1: */
struct
bch_extent_crc32
{
#if defined(__LITTLE_ENDIAN_BITFIELD)
...
...
@@ -594,10 +598,10 @@ union bch_extent_entry {
#else
#error edit for your odd byteorder.
#endif
struct
bch_extent_crc32
crc32
;
struct
bch_extent_crc64
crc64
;
struct
bch_extent_crc128
crc128
;
struct
bch_extent_ptr
ptr
;
#define x(f, n) struct bch_extent_##f f
;
BCH_EXTENT_ENTRY_TYPES
()
#undef x
};
enum
{
...
...
fs/bcachefs/extents.h
View file @
abce30b7
...
...
@@ -162,14 +162,11 @@ extent_entry_type(const union bch_extent_entry *e)
static
inline
size_t
extent_entry_bytes
(
const
union
bch_extent_entry
*
entry
)
{
switch
(
extent_entry_type
(
entry
))
{
case
BCH_EXTENT_ENTRY_crc32
:
return
sizeof
(
struct
bch_extent_crc32
);
case
BCH_EXTENT_ENTRY_crc64
:
return
sizeof
(
struct
bch_extent_crc64
);
case
BCH_EXTENT_ENTRY_crc128
:
return
sizeof
(
struct
bch_extent_crc128
);
case
BCH_EXTENT_ENTRY_ptr
:
return
sizeof
(
struct
bch_extent_ptr
);
#define x(f, n) \
case BCH_EXTENT_ENTRY_##f: \
return sizeof(struct bch_extent_##f);
BCH_EXTENT_ENTRY_TYPES
()
#undef x
default:
BUG
();
}
...
...
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