diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-01-27 06:05:03 +0100 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-03-10 20:34:08 +0100 |
commit | a555bcf4fa8dea612564d1133dad881c6681bae3 (patch) | |
tree | 264c820b0accdbb23ab5041eace23e251fffb35b /fs/bcachefs/journal_io.h | |
parent | bcachefs: Cleanup bch2_dirent_lookup_trans() (diff) | |
download | linux-a555bcf4fa8dea612564d1133dad881c6681bae3.tar.xz linux-a555bcf4fa8dea612564d1133dad881c6681bae3.zip |
bcachefs: convert journal replay ptrs to darray
Eliminates some error paths - no longer have a hardcoded
BCH_REPLICAS_MAX limit.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/journal_io.h')
-rw-r--r-- | fs/bcachefs/journal_io.h | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/fs/bcachefs/journal_io.h b/fs/bcachefs/journal_io.h index c035e7c108e1..1e0b9a571648 100644 --- a/fs/bcachefs/journal_io.h +++ b/fs/bcachefs/journal_io.h @@ -2,19 +2,22 @@ #ifndef _BCACHEFS_JOURNAL_IO_H #define _BCACHEFS_JOURNAL_IO_H +#include "darray.h" + +struct journal_ptr { + bool csum_good; + u8 dev; + u32 bucket; + u32 bucket_offset; + u64 sector; +}; + /* * Only used for holding the journal entries we read in btree_journal_read() * during cache_registration */ struct journal_replay { - struct journal_ptr { - bool csum_good; - u8 dev; - u32 bucket; - u32 bucket_offset; - u64 sector; - } ptrs[BCH_REPLICAS_MAX]; - unsigned nr_ptrs; + DARRAY_PREALLOCATED(struct journal_ptr, 8) ptrs; bool csum_good; bool ignore; |