bcachefs: extent_ptr_decoded

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2018-10-02 11:03:39 -04:00 committed by Kent Overstreet
parent deb3318b0e
commit 4cb1315666
9 changed files with 17 additions and 17 deletions

View File

@ -1407,7 +1407,7 @@ static void btree_node_read_endio(struct bio *bio)
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;

View File

@ -15,7 +15,7 @@ struct btree_read_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;
};

View File

@ -36,7 +36,7 @@ void __bch2_btree_verify(struct bch_fs *c, struct btree *b)
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;

View File

@ -603,7 +603,7 @@ static inline bool dev_latency_better(struct bch_fs *c,
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;
@ -622,7 +622,7 @@ static int extent_pick_read_device(struct bch_fs *c,
if (ret && !dev_latency_better(c, ptr, &pick->ptr))
continue;
*pick = (struct extent_pick_ptr) {
*pick = (struct extent_ptr_decoded) {
.ptr = *ptr,
.crc = crc,
};
@ -753,7 +753,7 @@ int bch2_btree_ptr_to_text(struct bch_fs *c, char *buf,
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);
@ -1958,7 +1958,7 @@ void bch2_extent_mark_replicas_cached(struct bch_fs *c,
*/
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;

View File

@ -55,11 +55,11 @@ struct btree_nr_keys bch2_extent_sort_fix_overlapping(struct bch_fs *c,
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 *);

View File

@ -19,9 +19,9 @@ struct bch_extent_crc_unpacked {
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 */

View File

@ -1026,7 +1026,7 @@ static void promote_start(struct promote_op *op, struct bch_read_bio *rbio)
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)
@ -1104,7 +1104,7 @@ err:
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,
@ -1411,7 +1411,7 @@ out:
}
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) &&
@ -1566,7 +1566,7 @@ int __bch2_read_extent(struct bch_fs *c, struct bch_read_bio *orig,
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;

View File

@ -99,7 +99,7 @@ static inline struct bch_write_bio *wbio_init(struct bio *bio)
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);

View File

@ -55,7 +55,7 @@ struct bch_read_bio {
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;