Lines Matching refs:new_a

845 	struct bch_alloc_v4 *new_a;  in bch2_trigger_alloc()  local
847 new_a = bkey_s_to_alloc_v4(new).v; in bch2_trigger_alloc()
855 new_a = &new_ka->v; in bch2_trigger_alloc()
859 alloc_data_type_set(new_a, new_a->data_type); in bch2_trigger_alloc()
861 if (bch2_bucket_sectors_total(*new_a) > bch2_bucket_sectors_total(*old_a)) { in bch2_trigger_alloc()
862 new_a->io_time[READ] = bch2_current_io_time(c, READ); in bch2_trigger_alloc()
863 new_a->io_time[WRITE]= bch2_current_io_time(c, WRITE); in bch2_trigger_alloc()
864 SET_BCH_ALLOC_V4_NEED_INC_GEN(new_a, true); in bch2_trigger_alloc()
865 SET_BCH_ALLOC_V4_NEED_DISCARD(new_a, true); in bch2_trigger_alloc()
868 if (data_type_is_empty(new_a->data_type) && in bch2_trigger_alloc()
869 BCH_ALLOC_V4_NEED_INC_GEN(new_a) && in bch2_trigger_alloc()
871 new_a->gen++; in bch2_trigger_alloc()
872 SET_BCH_ALLOC_V4_NEED_INC_GEN(new_a, false); in bch2_trigger_alloc()
873 alloc_data_type_set(new_a, new_a->data_type); in bch2_trigger_alloc()
876 if (old_a->data_type != new_a->data_type || in bch2_trigger_alloc()
877 (new_a->data_type == BCH_DATA_free && in bch2_trigger_alloc()
878 alloc_freespace_genbits(*old_a) != alloc_freespace_genbits(*new_a))) { in bch2_trigger_alloc()
880 bch2_bucket_do_index(trans, ca, new.s_c, new_a, true); in bch2_trigger_alloc()
885 if (new_a->data_type == BCH_DATA_cached && in bch2_trigger_alloc()
886 !new_a->io_time[READ]) in bch2_trigger_alloc()
887 new_a->io_time[READ] = bch2_current_io_time(c, READ); in bch2_trigger_alloc()
890 u64 new_lru = alloc_lru_idx_read(*new_a); in bch2_trigger_alloc()
900 new_lru = alloc_lru_idx_fragmentation(*new_a, ca); in bch2_trigger_alloc()
910 if (old_a->gen != new_a->gen) { in bch2_trigger_alloc()
911 ret = bch2_bucket_gen_update(trans, new.k->p, new_a->gen); in bch2_trigger_alloc()
925 ret = bch2_alloc_key_to_dev_counters(trans, ca, old_a, new_a, flags); in bch2_trigger_alloc()
932 u64 bucket_journal_seq = new_a->journal_seq; in bch2_trigger_alloc()
936 data_type_is_empty(new_a->data_type) && in bch2_trigger_alloc()
946 data_type_is_empty(new_a->data_type) && in bch2_trigger_alloc()
953 data_type_is_empty(new_a->data_type) && in bch2_trigger_alloc()
964 if (new_a->gen != old_a->gen) { in bch2_trigger_alloc()
971 *gen = new_a->gen; in bch2_trigger_alloc()
976 #define statechange(expr) !eval_state(old_a, expr) && eval_state(new_a, expr) in bch2_trigger_alloc()
980 bucket_flushed(new_a)) in bch2_trigger_alloc()
985 bucket_flushed(new_a)) in bch2_trigger_alloc()
1005 g->gen = new_a->gen; in bch2_trigger_alloc()