Lines Matching full:acc
66 static inline void bpos_to_disk_accounting_pos(struct disk_accounting_pos *acc, struct bpos p) in bpos_to_disk_accounting_pos() argument
68 BUILD_BUG_ON(sizeof(*acc) != sizeof(p)); in bpos_to_disk_accounting_pos()
71 acc->_pad = p; in bpos_to_disk_accounting_pos()
73 memcpy_swab(acc, &p, sizeof(p)); in bpos_to_disk_accounting_pos()
77 static inline struct bpos disk_accounting_pos_to_bpos(struct disk_accounting_pos *acc) in disk_accounting_pos_to_bpos() argument
81 p = acc->_pad; in disk_accounting_pos_to_bpos()
83 memcpy_swab(&p, acc, sizeof(p)); in disk_accounting_pos_to_bpos()
142 static inline bool bch2_accounting_is_mem(struct disk_accounting_pos acc) in bch2_accounting_is_mem() argument
144 return acc.type < BCH_DISK_ACCOUNTING_TYPE_NR && in bch2_accounting_is_mem()
145 acc.type != BCH_DISK_ACCOUNTING_inum; in bch2_accounting_is_mem()
158 struct bch_accounting_mem *acc = &c->accounting; in bch2_accounting_mem_mod_locked() local
163 if (gc && !acc->gc_running) in bch2_accounting_mem_mod_locked()
192 while ((idx = eytzinger0_find(acc->k.data, acc->k.nr, sizeof(acc->k.data[0]), in bch2_accounting_mem_mod_locked()
193 accounting_pos_cmp, &a.k->p)) >= acc->k.nr) { in bch2_accounting_mem_mod_locked()
203 struct accounting_mem_entry *e = &acc->k.data[idx]; in bch2_accounting_mem_mod_locked()
220 static inline void bch2_accounting_mem_read_counters(struct bch_accounting_mem *acc, in bch2_accounting_mem_read_counters() argument
225 if (unlikely(idx >= acc->k.nr)) in bch2_accounting_mem_read_counters()
228 struct accounting_mem_entry *e = &acc->k.data[idx]; in bch2_accounting_mem_read_counters()
240 struct bch_accounting_mem *acc = &c->accounting; in bch2_accounting_mem_read() local
241 unsigned idx = eytzinger0_find(acc->k.data, acc->k.nr, sizeof(acc->k.data[0]), in bch2_accounting_mem_read()
244 bch2_accounting_mem_read_counters(acc, idx, v, nr, false); in bch2_accounting_mem_read()