Skip to content

Commit 1cdcc6e

Browse files
author
Kent Overstreet
committed
bcachefs: Split out disk_groups_format.h
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
1 parent 4c5eef0 commit 1cdcc6e

2 files changed

Lines changed: 22 additions & 18 deletions

File tree

fs/bcachefs/bcachefs_format.h

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,7 @@ struct bch_sb_field {
507507
#include "ec_format.h"
508508
#include "inode_format.h"
509509
#include "dirent_format.h"
510+
#include "disk_groups_format.h"
510511
#include "xattr_format.h"
511512
#include "quota_format.h"
512513
#include "logged_ops_format.h"
@@ -665,24 +666,6 @@ struct bch_sb_field_replicas {
665666
struct bch_replicas_entry_v1 entries[];
666667
} __packed __aligned(8);
667668

668-
/* BCH_SB_FIELD_disk_groups: */
669-
670-
#define BCH_SB_LABEL_SIZE 32
671-
672-
struct bch_disk_group {
673-
__u8 label[BCH_SB_LABEL_SIZE];
674-
__le64 flags[2];
675-
} __packed __aligned(8);
676-
677-
LE64_BITMASK(BCH_GROUP_DELETED, struct bch_disk_group, flags[0], 0, 1)
678-
LE64_BITMASK(BCH_GROUP_DATA_ALLOWED, struct bch_disk_group, flags[0], 1, 6)
679-
LE64_BITMASK(BCH_GROUP_PARENT, struct bch_disk_group, flags[0], 6, 24)
680-
681-
struct bch_sb_field_disk_groups {
682-
struct bch_sb_field field;
683-
struct bch_disk_group entries[];
684-
} __packed __aligned(8);
685-
686669
/*
687670
* On clean shutdown, store btree roots and current journal sequence number in
688671
* the superblock:

fs/bcachefs/disk_groups_format.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
#ifndef _BCACHEFS_DISK_GROUPS_FORMAT_H
3+
#define _BCACHEFS_DISK_GROUPS_FORMAT_H
4+
5+
#define BCH_SB_LABEL_SIZE 32
6+
7+
struct bch_disk_group {
8+
__u8 label[BCH_SB_LABEL_SIZE];
9+
__le64 flags[2];
10+
} __packed __aligned(8);
11+
12+
LE64_BITMASK(BCH_GROUP_DELETED, struct bch_disk_group, flags[0], 0, 1)
13+
LE64_BITMASK(BCH_GROUP_DATA_ALLOWED, struct bch_disk_group, flags[0], 1, 6)
14+
LE64_BITMASK(BCH_GROUP_PARENT, struct bch_disk_group, flags[0], 6, 24)
15+
16+
struct bch_sb_field_disk_groups {
17+
struct bch_sb_field field;
18+
struct bch_disk_group entries[];
19+
} __packed __aligned(8);
20+
21+
#endif /* _BCACHEFS_DISK_GROUPS_FORMAT_H */

0 commit comments

Comments
 (0)