Lines Matching refs:trans

28 			"pin journal entry referred to by trans->journal_res.seq")	\
70 static inline int bch2_btree_delete_at_buffered(struct btree_trans *trans,
73 return bch2_btree_bit_mod_buffered(trans, btree, pos, false);
86 static inline int bch2_insert_snapshot_whiteouts(struct btree_trans *trans,
95 return __bch2_insert_snapshot_whiteouts(trans, btree, old_pos, new_pos);
110 static inline struct jset_entry *btree_trans_journal_entries_top(struct btree_trans *trans)
112 return (void *) ((u64 *) trans->journal_entries + trans->journal_entries_u64s);
116 bch2_trans_jset_entry_alloc(struct btree_trans *trans, unsigned u64s)
118 if (!trans->journal_entries ||
119 trans->journal_entries_u64s + u64s > trans->journal_entries_size)
120 return __bch2_trans_jset_entry_alloc(trans, u64s);
122 struct jset_entry *e = btree_trans_journal_entries_top(trans);
123 trans->journal_entries_u64s += u64s;
132 static inline int __must_check bch2_trans_update_buffered(struct btree_trans *trans,
137 int ret = bch2_btree_write_buffer_insert_err(trans, btree, k);
153 unlikely(trans->journal_replay_not_finished))
154 return bch2_btree_insert_clone_trans(trans, btree, k);
156 struct jset_entry *e = bch2_trans_jset_entry_alloc(trans, jset_u64s(k->k.u64s));
183 static inline int bch2_trans_commit(struct btree_trans *trans,
188 trans->disk_res = disk_res;
189 trans->journal_seq = journal_seq;
191 return __bch2_trans_commit(trans, flags);
203 bch2_trans_run(_c, commit_do(trans, _disk_res, _journal_seq, _flags, _do))
210 static inline void bch2_trans_reset_updates(struct btree_trans *trans)
212 trans_for_each_update(trans, i)
213 bch2_path_put(trans, i->path, true);
215 trans->nr_updates = 0;
216 trans->journal_entries_u64s = 0;
217 trans->hooks = NULL;
218 trans->extra_disk_res = 0;
221 static inline struct bkey_i *__bch2_bkey_make_mut_noupdate(struct btree_trans *trans, struct bkey_s_c k,
231 mut = bch2_trans_kmalloc_nomemzero(trans, bytes + 8);
244 static inline struct bkey_i *bch2_bkey_make_mut_noupdate(struct btree_trans *trans, struct bkey_s_c k)
246 return __bch2_bkey_make_mut_noupdate(trans, k, 0, 0);
253 static inline struct bkey_i *__bch2_bkey_make_mut(struct btree_trans *trans, struct btree_iter *iter,
258 struct bkey_i *mut = __bch2_bkey_make_mut_noupdate(trans, *k, type, min_bytes);
264 ret = bch2_trans_update(trans, iter, mut, flags);
272 static inline struct bkey_i *bch2_bkey_make_mut(struct btree_trans *trans,
276 return __bch2_bkey_make_mut(trans, iter, k, flags, 0, 0);
283 static inline struct bkey_i *__bch2_bkey_get_mut_noupdate(struct btree_trans *trans,
289 struct bkey_s_c k = __bch2_bkey_get_iter(trans, iter,
293 : __bch2_bkey_make_mut_noupdate(trans, k, 0, min_bytes);
295 bch2_trans_iter_exit(trans, iter);
299 static inline struct bkey_i *bch2_bkey_get_mut_noupdate(struct btree_trans *trans,
304 return __bch2_bkey_get_mut_noupdate(trans, iter, btree_id, pos, flags, 0, 0);
307 static inline struct bkey_i *__bch2_bkey_get_mut(struct btree_trans *trans,
313 struct bkey_i *mut = __bch2_bkey_get_mut_noupdate(trans, iter,
320 ret = bch2_trans_update(trans, iter, mut, flags);
322 bch2_trans_iter_exit(trans, iter);
329 static inline struct bkey_i *bch2_bkey_get_mut_minsize(struct btree_trans *trans,
335 return __bch2_bkey_get_mut(trans, iter, btree_id, pos, flags, 0, min_bytes);
338 static inline struct bkey_i *bch2_bkey_get_mut(struct btree_trans *trans,
343 return __bch2_bkey_get_mut(trans, iter, btree_id, pos, flags, 0, 0);
351 static inline struct bkey_i *__bch2_bkey_alloc(struct btree_trans *trans, struct btree_iter *iter,
355 struct bkey_i *k = bch2_trans_kmalloc(trans, sizeof(*k) + val_size);
366 ret = bch2_trans_update(trans, iter, k, flags);