-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'bcachefs-2024-01-21' of https://evilpiepirate.org/git/bcac…
…hefs Pull more bcachefs updates from Kent Overstreet: "Some fixes, Some refactoring, some minor features: - Assorted prep work for disk space accounting rewrite - BTREE_TRIGGER_ATOMIC: after combining our trigger callbacks, this makes our trigger context more explicit - A few fixes to avoid excessive transaction restarts on multithreaded workloads: fstests (in addition to ktest tests) are now checking slowpath counters, and that's shaking out a few bugs - Assorted tracepoint improvements - Starting to break up bcachefs_format.h and move on disk types so they're with the code they belong to; this will make room to start documenting the on disk format better. - A few minor fixes" * tag 'bcachefs-2024-01-21' of https://evilpiepirate.org/git/bcachefs: (46 commits) bcachefs: Improve inode_to_text() bcachefs: logged_ops_format.h bcachefs: reflink_format.h bcachefs; extents_format.h bcachefs: ec_format.h bcachefs: subvolume_format.h bcachefs: snapshot_format.h bcachefs: alloc_background_format.h bcachefs: xattr_format.h bcachefs: dirent_format.h bcachefs: inode_format.h bcachefs; quota_format.h bcachefs: sb-counters_format.h bcachefs: counters.c -> sb-counters.c bcachefs: comment bch_subvolume bcachefs: bch_snapshot::btime bcachefs: add missing __GFP_NOWARN bcachefs: opts->compression can now also be applied in the background bcachefs: Prep work for variable size btree node buffers bcachefs: grab s_umount only if snapshotting ...
- Loading branch information
Showing
78 changed files
with
1,629 additions
and
1,426 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
#ifndef _BCACHEFS_ALLOC_BACKGROUND_FORMAT_H | ||
#define _BCACHEFS_ALLOC_BACKGROUND_FORMAT_H | ||
|
||
struct bch_alloc { | ||
struct bch_val v; | ||
__u8 fields; | ||
__u8 gen; | ||
__u8 data[]; | ||
} __packed __aligned(8); | ||
|
||
#define BCH_ALLOC_FIELDS_V1() \ | ||
x(read_time, 16) \ | ||
x(write_time, 16) \ | ||
x(data_type, 8) \ | ||
x(dirty_sectors, 16) \ | ||
x(cached_sectors, 16) \ | ||
x(oldest_gen, 8) \ | ||
x(stripe, 32) \ | ||
x(stripe_redundancy, 8) | ||
|
||
enum { | ||
#define x(name, _bits) BCH_ALLOC_FIELD_V1_##name, | ||
BCH_ALLOC_FIELDS_V1() | ||
#undef x | ||
}; | ||
|
||
struct bch_alloc_v2 { | ||
struct bch_val v; | ||
__u8 nr_fields; | ||
__u8 gen; | ||
__u8 oldest_gen; | ||
__u8 data_type; | ||
__u8 data[]; | ||
} __packed __aligned(8); | ||
|
||
#define BCH_ALLOC_FIELDS_V2() \ | ||
x(read_time, 64) \ | ||
x(write_time, 64) \ | ||
x(dirty_sectors, 32) \ | ||
x(cached_sectors, 32) \ | ||
x(stripe, 32) \ | ||
x(stripe_redundancy, 8) | ||
|
||
struct bch_alloc_v3 { | ||
struct bch_val v; | ||
__le64 journal_seq; | ||
__le32 flags; | ||
__u8 nr_fields; | ||
__u8 gen; | ||
__u8 oldest_gen; | ||
__u8 data_type; | ||
__u8 data[]; | ||
} __packed __aligned(8); | ||
|
||
LE32_BITMASK(BCH_ALLOC_V3_NEED_DISCARD,struct bch_alloc_v3, flags, 0, 1) | ||
LE32_BITMASK(BCH_ALLOC_V3_NEED_INC_GEN,struct bch_alloc_v3, flags, 1, 2) | ||
|
||
struct bch_alloc_v4 { | ||
struct bch_val v; | ||
__u64 journal_seq; | ||
__u32 flags; | ||
__u8 gen; | ||
__u8 oldest_gen; | ||
__u8 data_type; | ||
__u8 stripe_redundancy; | ||
__u32 dirty_sectors; | ||
__u32 cached_sectors; | ||
__u64 io_time[2]; | ||
__u32 stripe; | ||
__u32 nr_external_backpointers; | ||
__u64 fragmentation_lru; | ||
} __packed __aligned(8); | ||
|
||
#define BCH_ALLOC_V4_U64s_V0 6 | ||
#define BCH_ALLOC_V4_U64s (sizeof(struct bch_alloc_v4) / sizeof(__u64)) | ||
|
||
BITMASK(BCH_ALLOC_V4_NEED_DISCARD, struct bch_alloc_v4, flags, 0, 1) | ||
BITMASK(BCH_ALLOC_V4_NEED_INC_GEN, struct bch_alloc_v4, flags, 1, 2) | ||
BITMASK(BCH_ALLOC_V4_BACKPOINTERS_START,struct bch_alloc_v4, flags, 2, 8) | ||
BITMASK(BCH_ALLOC_V4_NR_BACKPOINTERS, struct bch_alloc_v4, flags, 8, 14) | ||
|
||
#define KEY_TYPE_BUCKET_GENS_BITS 8 | ||
#define KEY_TYPE_BUCKET_GENS_NR (1U << KEY_TYPE_BUCKET_GENS_BITS) | ||
#define KEY_TYPE_BUCKET_GENS_MASK (KEY_TYPE_BUCKET_GENS_NR - 1) | ||
|
||
struct bch_bucket_gens { | ||
struct bch_val v; | ||
u8 gens[KEY_TYPE_BUCKET_GENS_NR]; | ||
} __packed __aligned(8); | ||
|
||
#endif /* _BCACHEFS_ALLOC_BACKGROUND_FORMAT_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.