void bch2_btree_node_read(struct bch_fs *c, struct btree *b,
bool sync)
{
- struct extent_pick_ptr pick;
+ struct extent_ptr_decoded pick;
struct btree_read_bio *rb;
struct bch_dev *ca;
struct bio *bio;
struct bch_fs *c;
u64 start_time;
unsigned have_ioref:1;
- struct extent_pick_ptr pick;
+ struct extent_ptr_decoded pick;
struct work_struct work;
struct bio bio;
};
struct btree *v = c->verify_data;
struct btree_node *n_ondisk, *n_sorted, *n_inmemory;
struct bset *sorted, *inmemory;
- struct extent_pick_ptr pick;
+ struct extent_ptr_decoded pick;
struct bch_dev *ca;
struct bio *bio;
static int extent_pick_read_device(struct bch_fs *c,
struct bkey_s_c_extent e,
struct bch_devs_mask *avoid,
- struct extent_pick_ptr *pick)
+ struct extent_ptr_decoded *pick)
{
const struct bch_extent_ptr *ptr;
struct bch_extent_crc_unpacked crc;
if (ret && !dev_latency_better(c, ptr, &pick->ptr))
continue;
- *pick = (struct extent_pick_ptr) {
+ *pick = (struct extent_ptr_decoded) {
.ptr = *ptr,
.crc = crc,
};
int bch2_btree_pick_ptr(struct bch_fs *c, const struct btree *b,
struct bch_devs_mask *avoid,
- struct extent_pick_ptr *pick)
+ struct extent_ptr_decoded *pick)
{
return extent_pick_read_device(c, bkey_i_to_s_c_extent(&b->key),
avoid, pick);
*/
int bch2_extent_pick_ptr(struct bch_fs *c, struct bkey_s_c k,
struct bch_devs_mask *avoid,
- struct extent_pick_ptr *pick)
+ struct extent_ptr_decoded *pick)
{
int ret;
int bch2_btree_pick_ptr(struct bch_fs *, const struct btree *,
struct bch_devs_mask *avoid,
- struct extent_pick_ptr *);
+ struct extent_ptr_decoded *);
int bch2_extent_pick_ptr(struct bch_fs *, struct bkey_s_c,
struct bch_devs_mask *,
- struct extent_pick_ptr *);
+ struct extent_ptr_decoded *);
void bch2_extent_trim_atomic(struct bkey_i *, struct btree_iter *);
struct bch_csum csum;
};
-struct extent_pick_ptr {
- struct bch_extent_ptr ptr;
+struct extent_ptr_decoded {
struct bch_extent_crc_unpacked crc;
+ struct bch_extent_ptr ptr;
};
#endif /* _BCACHEFS_EXTENTS_TYPES_H */
noinline
static struct promote_op *__promote_alloc(struct bch_fs *c,
struct bpos pos,
- struct extent_pick_ptr *pick,
+ struct extent_ptr_decoded *pick,
struct bch_io_opts opts,
unsigned rbio_sectors,
struct bch_read_bio **rbio)
static inline struct promote_op *promote_alloc(struct bch_fs *c,
struct bvec_iter iter,
struct bkey_s_c k,
- struct extent_pick_ptr *pick,
+ struct extent_ptr_decoded *pick,
struct bch_io_opts opts,
unsigned flags,
struct bch_read_bio **rbio,
}
static bool should_narrow_crcs(struct bkey_s_c k,
- struct extent_pick_ptr *pick,
+ struct extent_ptr_decoded *pick,
unsigned flags)
{
return !(flags & BCH_READ_IN_RETRY) &&
struct bvec_iter iter, struct bkey_s_c k,
struct bch_devs_mask *avoid, unsigned flags)
{
- struct extent_pick_ptr pick;
+ struct extent_ptr_decoded pick;
struct bch_read_bio *rbio = NULL;
struct bch_dev *ca;
struct promote_op *promote = NULL;
struct bch_devs_mask;
struct cache_promote_op;
-struct extent_pick_ptr;
+struct extent_ptr_decoded;
int __bch2_read_extent(struct bch_fs *, struct bch_read_bio *, struct bvec_iter,
struct bkey_s_c, struct bch_devs_mask *, unsigned);
struct bch_devs_list devs_have;
- struct extent_pick_ptr pick;
+ struct extent_ptr_decoded pick;
/* start pos of data we read (may not be pos of data we want) */
struct bpos pos;
struct bversion version;