1 /* SPDX-License-Identifier: GPL-2.0 */ 2 #ifndef _BCACHEFS_MOVE_TYPES_H 3 #define _BCACHEFS_MOVE_TYPES_H 4 5 #include "bbpos_types.h" 6 #include "bcachefs_ioctl.h" 7 8 struct bch_move_stats { 9 char name[32]; 10 bool phys; 11 enum bch_ioctl_data_event_ret ret; 12 13 union { 14 struct { 15 enum bch_data_type data_type; 16 struct bbpos pos; 17 }; 18 struct { 19 unsigned dev; 20 u64 offset; 21 }; 22 }; 23 24 atomic64_t keys_moved; 25 atomic64_t keys_raced; 26 atomic64_t sectors_seen; 27 atomic64_t sectors_moved; 28 atomic64_t sectors_raced; 29 atomic64_t sectors_error_corrected; 30 atomic64_t sectors_error_uncorrected; 31 }; 32 33 struct move_bucket_key { 34 struct bpos bucket; 35 unsigned gen; 36 }; 37 38 struct move_bucket { 39 struct move_bucket *next; 40 struct rhash_head hash; 41 struct move_bucket_key k; 42 unsigned sectors; 43 atomic_t count; 44 }; 45 46 #endif /* _BCACHEFS_MOVE_TYPES_H */ 47