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
24998050
Commit
24998050
authored
May 28, 2024
by
Kent Overstreet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: Split out replicas_format.h
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
1cdcc6e3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
32 deletions
+36
-32
fs/bcachefs/bcachefs_format.h
fs/bcachefs/bcachefs_format.h
+5
-32
fs/bcachefs/replicas_format.h
fs/bcachefs/replicas_format.h
+31
-0
No files found.
fs/bcachefs/bcachefs_format.h
View file @
24998050
...
@@ -503,19 +503,20 @@ struct bch_sb_field {
...
@@ -503,19 +503,20 @@ struct bch_sb_field {
#include "alloc_background_format.h"
#include "alloc_background_format.h"
#include "extents_format.h"
#include "extents_format.h"
#include "reflink_format.h"
#include "ec_format.h"
#include "ec_format.h"
#include "inode_format.h"
#include "dirent_format.h"
#include "dirent_format.h"
#include "disk_groups_format.h"
#include "disk_groups_format.h"
#include "xattr_format.h"
#include "inode_format.h"
#include "quota_format.h"
#include "logged_ops_format.h"
#include "logged_ops_format.h"
#include "quota_format.h"
#include "reflink_format.h"
#include "replicas_format.h"
#include "snapshot_format.h"
#include "snapshot_format.h"
#include "subvolume_format.h"
#include "subvolume_format.h"
#include "sb-counters_format.h"
#include "sb-counters_format.h"
#include "sb-downgrade_format.h"
#include "sb-downgrade_format.h"
#include "sb-members_format.h"
#include "sb-members_format.h"
#include "xattr_format.h"
enum
bch_sb_field_type
{
enum
bch_sb_field_type
{
#define x(f, nr) BCH_SB_FIELD_##f = nr,
#define x(f, nr) BCH_SB_FIELD_##f = nr,
...
@@ -596,8 +597,6 @@ LE64_BITMASK(BCH_KDF_SCRYPT_N, struct bch_sb_field_crypt, kdf_flags, 0, 16);
...
@@ -596,8 +597,6 @@ LE64_BITMASK(BCH_KDF_SCRYPT_N, struct bch_sb_field_crypt, kdf_flags, 0, 16);
LE64_BITMASK
(
BCH_KDF_SCRYPT_R
,
struct
bch_sb_field_crypt
,
kdf_flags
,
16
,
32
);
LE64_BITMASK
(
BCH_KDF_SCRYPT_R
,
struct
bch_sb_field_crypt
,
kdf_flags
,
16
,
32
);
LE64_BITMASK
(
BCH_KDF_SCRYPT_P
,
struct
bch_sb_field_crypt
,
kdf_flags
,
32
,
48
);
LE64_BITMASK
(
BCH_KDF_SCRYPT_P
,
struct
bch_sb_field_crypt
,
kdf_flags
,
32
,
48
);
/* BCH_SB_FIELD_replicas: */
#define BCH_DATA_TYPES() \
#define BCH_DATA_TYPES() \
x(free, 0) \
x(free, 0) \
x(sb, 1) \
x(sb, 1) \
...
@@ -640,32 +639,6 @@ static inline bool data_type_is_hidden(enum bch_data_type type)
...
@@ -640,32 +639,6 @@ static inline bool data_type_is_hidden(enum bch_data_type type)
}
}
}
}
struct
bch_replicas_entry_v0
{
__u8
data_type
;
__u8
nr_devs
;
__u8
devs
[];
}
__packed
;
struct
bch_sb_field_replicas_v0
{
struct
bch_sb_field
field
;
struct
bch_replicas_entry_v0
entries
[];
}
__packed
__aligned
(
8
);
struct
bch_replicas_entry_v1
{
__u8
data_type
;
__u8
nr_devs
;
__u8
nr_required
;
__u8
devs
[];
}
__packed
;
#define replicas_entry_bytes(_i) \
(offsetof(typeof(*(_i)), devs) + (_i)->nr_devs)
struct
bch_sb_field_replicas
{
struct
bch_sb_field
field
;
struct
bch_replicas_entry_v1
entries
[];
}
__packed
__aligned
(
8
);
/*
/*
* On clean shutdown, store btree roots and current journal sequence number in
* On clean shutdown, store btree roots and current journal sequence number in
* the superblock:
* the superblock:
...
...
fs/bcachefs/replicas_format.h
0 → 100644
View file @
24998050
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _BCACHEFS_REPLICAS_FORMAT_H
#define _BCACHEFS_REPLICAS_FORMAT_H
struct
bch_replicas_entry_v0
{
__u8
data_type
;
__u8
nr_devs
;
__u8
devs
[];
}
__packed
;
struct
bch_sb_field_replicas_v0
{
struct
bch_sb_field
field
;
struct
bch_replicas_entry_v0
entries
[];
}
__packed
__aligned
(
8
);
struct
bch_replicas_entry_v1
{
__u8
data_type
;
__u8
nr_devs
;
__u8
nr_required
;
__u8
devs
[];
}
__packed
;
struct
bch_sb_field_replicas
{
struct
bch_sb_field
field
;
struct
bch_replicas_entry_v1
entries
[];
}
__packed
__aligned
(
8
);
#define replicas_entry_bytes(_i) \
(offsetof(typeof(*(_i)), devs) + (_i)->nr_devs)
#endif
/* _BCACHEFS_REPLICAS_FORMAT_H */
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