Lines Matching refs:trans

72 static inline int bch2_btree_delete_at_buffered(struct btree_trans *trans,  in bch2_btree_delete_at_buffered()  argument
75 return bch2_btree_bit_mod_buffered(trans, btree, pos, false); in bch2_btree_delete_at_buffered()
88 static inline int bch2_insert_snapshot_whiteouts(struct btree_trans *trans, in bch2_insert_snapshot_whiteouts() argument
97 return __bch2_insert_snapshot_whiteouts(trans, btree, old_pos, new_pos); in bch2_insert_snapshot_whiteouts()
112 static inline struct jset_entry *btree_trans_journal_entries_top(struct btree_trans *trans) in btree_trans_journal_entries_top() argument
114 return (void *) ((u64 *) trans->journal_entries + trans->journal_entries_u64s); in btree_trans_journal_entries_top()
118 bch2_trans_jset_entry_alloc(struct btree_trans *trans, unsigned u64s) in bch2_trans_jset_entry_alloc() argument
120 if (!trans->journal_entries || in bch2_trans_jset_entry_alloc()
121 trans->journal_entries_u64s + u64s > trans->journal_entries_size) in bch2_trans_jset_entry_alloc()
122 return __bch2_trans_jset_entry_alloc(trans, u64s); in bch2_trans_jset_entry_alloc()
124 struct jset_entry *e = btree_trans_journal_entries_top(trans); in bch2_trans_jset_entry_alloc()
125 trans->journal_entries_u64s += u64s; in bch2_trans_jset_entry_alloc()
131 static inline int __must_check bch2_trans_update_buffered(struct btree_trans *trans, in bch2_trans_update_buffered() argument
147 unlikely(trans->journal_replay_not_finished)) in bch2_trans_update_buffered()
148 return bch2_btree_insert_clone_trans(trans, btree, k); in bch2_trans_update_buffered()
150 struct jset_entry *e = bch2_trans_jset_entry_alloc(trans, jset_u64s(k->k.u64s)); in bch2_trans_update_buffered()
176 static inline int bch2_trans_commit(struct btree_trans *trans, in bch2_trans_commit() argument
181 trans->disk_res = disk_res; in bch2_trans_commit()
182 trans->journal_seq = journal_seq; in bch2_trans_commit()
184 return __bch2_trans_commit(trans, flags); in bch2_trans_commit()
196 bch2_trans_run(_c, commit_do(trans, _disk_res, _journal_seq, _flags, _do))
203 static inline void bch2_trans_reset_updates(struct btree_trans *trans) in bch2_trans_reset_updates() argument
205 trans_for_each_update(trans, i) in bch2_trans_reset_updates()
206 bch2_path_put(trans, i->path, true); in bch2_trans_reset_updates()
208 trans->nr_updates = 0; in bch2_trans_reset_updates()
209 trans->journal_entries_u64s = 0; in bch2_trans_reset_updates()
210 trans->hooks = NULL; in bch2_trans_reset_updates()
211 trans->extra_disk_res = 0; in bch2_trans_reset_updates()
214 static inline struct bkey_i *__bch2_bkey_make_mut_noupdate(struct btree_trans *trans, struct bkey_s… in __bch2_bkey_make_mut_noupdate() argument
224 mut = bch2_trans_kmalloc_nomemzero(trans, bytes + 8); in __bch2_bkey_make_mut_noupdate()
237 static inline struct bkey_i *bch2_bkey_make_mut_noupdate(struct btree_trans *trans, struct bkey_s_c… in bch2_bkey_make_mut_noupdate() argument
239 return __bch2_bkey_make_mut_noupdate(trans, k, 0, 0); in bch2_bkey_make_mut_noupdate()
246 static inline struct bkey_i *__bch2_bkey_make_mut(struct btree_trans *trans, struct btree_iter *ite… in __bch2_bkey_make_mut() argument
250 struct bkey_i *mut = __bch2_bkey_make_mut_noupdate(trans, *k, type, min_bytes); in __bch2_bkey_make_mut()
256 ret = bch2_trans_update(trans, iter, mut, flags); in __bch2_bkey_make_mut()
264 static inline struct bkey_i *bch2_bkey_make_mut(struct btree_trans *trans, struct btree_iter *iter, in bch2_bkey_make_mut() argument
267 return __bch2_bkey_make_mut(trans, iter, k, flags, 0, 0); in bch2_bkey_make_mut()
274 static inline struct bkey_i *__bch2_bkey_get_mut_noupdate(struct btree_trans *trans, in __bch2_bkey_get_mut_noupdate() argument
279 struct bkey_s_c k = __bch2_bkey_get_iter(trans, iter, in __bch2_bkey_get_mut_noupdate()
283 : __bch2_bkey_make_mut_noupdate(trans, k, 0, min_bytes); in __bch2_bkey_get_mut_noupdate()
285 bch2_trans_iter_exit(trans, iter); in __bch2_bkey_get_mut_noupdate()
289 static inline struct bkey_i *bch2_bkey_get_mut_noupdate(struct btree_trans *trans, in bch2_bkey_get_mut_noupdate() argument
294 return __bch2_bkey_get_mut_noupdate(trans, iter, btree_id, pos, flags, 0, 0); in bch2_bkey_get_mut_noupdate()
297 static inline struct bkey_i *__bch2_bkey_get_mut(struct btree_trans *trans, in __bch2_bkey_get_mut() argument
302 struct bkey_i *mut = __bch2_bkey_get_mut_noupdate(trans, iter, in __bch2_bkey_get_mut()
309 ret = bch2_trans_update(trans, iter, mut, flags); in __bch2_bkey_get_mut()
311 bch2_trans_iter_exit(trans, iter); in __bch2_bkey_get_mut()
318 static inline struct bkey_i *bch2_bkey_get_mut_minsize(struct btree_trans *trans, in bch2_bkey_get_mut_minsize() argument
323 return __bch2_bkey_get_mut(trans, iter, btree_id, pos, flags, 0, min_bytes); in bch2_bkey_get_mut_minsize()
326 static inline struct bkey_i *bch2_bkey_get_mut(struct btree_trans *trans, in bch2_bkey_get_mut() argument
331 return __bch2_bkey_get_mut(trans, iter, btree_id, pos, flags, 0, 0); in bch2_bkey_get_mut()
339 static inline struct bkey_i *__bch2_bkey_alloc(struct btree_trans *trans, struct btree_iter *iter, in __bch2_bkey_alloc() argument
342 struct bkey_i *k = bch2_trans_kmalloc(trans, sizeof(*k) + val_size); in __bch2_bkey_alloc()
353 ret = bch2_trans_update(trans, iter, k, flags); in __bch2_bkey_alloc()