1 /* SPDX-License-Identifier: GPL-2.0 */ 2 #ifndef _BCACHEFS_EXTENTS_TYPES_H 3 #define _BCACHEFS_EXTENTS_TYPES_H 4 5 #include "bcachefs_format.h" 6 7 struct bch_extent_crc_unpacked { 8 u32 compressed_size; 9 u32 uncompressed_size; 10 u32 live_size; 11 12 u8 csum_type; 13 u8 compression_type; 14 15 u16 offset; 16 17 u16 nonce; 18 19 struct bch_csum csum; 20 }; 21 22 struct extent_ptr_decoded { 23 bool has_ec; 24 bool do_ec_reconstruct; 25 u8 crc_retry_nr; 26 struct bch_extent_crc_unpacked crc; 27 struct bch_extent_ptr ptr; 28 struct bch_extent_stripe_ptr ec; 29 }; 30 31 struct bch_io_failures { 32 u8 nr; 33 struct bch_dev_io_failures { 34 u8 dev; 35 unsigned failed_csum_nr:6, 36 failed_io:1, 37 failed_ec:1; 38 } devs[BCH_REPLICAS_MAX + 1]; 39 }; 40 41 #endif /* _BCACHEFS_EXTENTS_TYPES_H */ 42