Lines Matching refs:tr
95 struct gfs2_trans *tr, in gfs2_ail1_start_one() argument
105 list_for_each_entry_safe_reverse(bd, s, &tr->tr_ail1_list, bd_ail_st_list) { in gfs2_ail1_start_one()
108 gfs2_assert(sdp, bd->bd_tr == tr); in gfs2_ail1_start_one()
115 list_move(&bd->bd_ail_st_list, &tr->tr_ail2_list); in gfs2_ail1_start_one()
124 list_move(&bd->bd_ail_st_list, &tr->tr_ail1_list); in gfs2_ail1_start_one()
152 struct gfs2_trans *tr; in gfs2_ail1_flush() local
160 list_for_each_entry_reverse(tr, head, tr_list) { in gfs2_ail1_flush()
163 if (gfs2_ail1_start_one(sdp, wbc, tr, &withdraw)) in gfs2_ail1_flush()
197 static void gfs2_ail1_empty_one(struct gfs2_sbd *sdp, struct gfs2_trans *tr, in gfs2_ail1_empty_one() argument
203 list_for_each_entry_safe_reverse(bd, s, &tr->tr_ail1_list, in gfs2_ail1_empty_one()
206 gfs2_assert(sdp, bd->bd_tr == tr); in gfs2_ail1_empty_one()
213 list_move(&bd->bd_ail_st_list, &tr->tr_ail2_list); in gfs2_ail1_empty_one()
226 struct gfs2_trans *tr, *s; in gfs2_ail1_empty() local
232 list_for_each_entry_safe_reverse(tr, s, &sdp->sd_ail1_list, tr_list) { in gfs2_ail1_empty()
233 gfs2_ail1_empty_one(sdp, tr, &withdraw); in gfs2_ail1_empty()
234 if (list_empty(&tr->tr_ail1_list) && oldest_tr) in gfs2_ail1_empty()
235 list_move(&tr->tr_list, &sdp->sd_ail2_list); in gfs2_ail1_empty()
250 struct gfs2_trans *tr; in gfs2_ail1_wait() local
255 list_for_each_entry_reverse(tr, &sdp->sd_ail1_list, tr_list) { in gfs2_ail1_wait()
256 list_for_each_entry(bd, &tr->tr_ail1_list, bd_ail_st_list) { in gfs2_ail1_wait()
277 static void gfs2_ail2_empty_one(struct gfs2_sbd *sdp, struct gfs2_trans *tr) in gfs2_ail2_empty_one() argument
279 struct list_head *head = &tr->tr_ail2_list; in gfs2_ail2_empty_one()
285 gfs2_assert(sdp, bd->bd_tr == tr); in gfs2_ail2_empty_one()
292 struct gfs2_trans *tr, *safe; in ail2_empty() local
299 list_for_each_entry_safe(tr, safe, &sdp->sd_ail2_list, tr_list) { in ail2_empty()
300 a = (old_tail <= tr->tr_first); in ail2_empty()
301 b = (tr->tr_first < new_tail); in ail2_empty()
306 gfs2_ail2_empty_one(sdp, tr); in ail2_empty()
307 list_del(&tr->tr_list); in ail2_empty()
308 gfs2_assert_warn(sdp, list_empty(&tr->tr_ail1_list)); in ail2_empty()
309 gfs2_assert_warn(sdp, list_empty(&tr->tr_ail2_list)); in ail2_empty()
310 kfree(tr); in ail2_empty()
461 struct gfs2_trans *tr = sdp->sd_log_tr; in calc_reserved() local
463 if (tr) { in calc_reserved()
464 mbuf = tr->tr_num_buf_new - tr->tr_num_buf_rm; in calc_reserved()
465 dbuf = tr->tr_num_databuf_new - tr->tr_num_databuf_rm; in calc_reserved()
483 struct gfs2_trans *tr; in current_tail() local
491 tr = list_entry(sdp->sd_ail1_list.prev, struct gfs2_trans, in current_tail()
493 tail = tr->tr_first; in current_tail()
614 struct gfs2_trans *tr; in gfs2_write_revokes() local
621 list_for_each_entry(tr, &sdp->sd_ail1_list, tr_list) { in gfs2_write_revokes()
622 list_for_each_entry(bd, &tr->tr_ail2_list, bd_ail_st_list) { in gfs2_write_revokes()
645 list_for_each_entry(tr, &sdp->sd_ail1_list, tr_list) { in gfs2_write_revokes()
646 list_for_each_entry_safe(bd, tmp, &tr->tr_ail2_list, bd_ail_st_list) { in gfs2_write_revokes()
778 struct gfs2_trans *tr; in gfs2_log_flush() local
794 tr = sdp->sd_log_tr; in gfs2_log_flush()
795 if (tr) { in gfs2_log_flush()
797 INIT_LIST_HEAD(&tr->tr_ail1_list); in gfs2_log_flush()
798 INIT_LIST_HEAD(&tr->tr_ail2_list); in gfs2_log_flush()
799 tr->tr_first = sdp->sd_log_flush_head; in gfs2_log_flush()
801 gfs2_assert_withdraw(sdp, !tr->tr_num_buf_new && !tr->tr_num_databuf_new); in gfs2_log_flush()
810 lops_before_commit(sdp, tr); in gfs2_log_flush()
821 lops_after_commit(sdp, tr); in gfs2_log_flush()
829 if (tr && !list_empty(&tr->tr_ail1_list)) { in gfs2_log_flush()
830 list_add(&tr->tr_list, &sdp->sd_ail1_list); in gfs2_log_flush()
831 tr = NULL; in gfs2_log_flush()
859 kfree(tr); in gfs2_log_flush()
883 static void log_refund(struct gfs2_sbd *sdp, struct gfs2_trans *tr) in log_refund() argument
892 gfs2_merge_trans(sdp->sd_log_tr, tr); in log_refund()
893 } else if (tr->tr_num_buf_new || tr->tr_num_databuf_new) { in log_refund()
894 gfs2_assert_withdraw(sdp, test_bit(TR_ALLOCED, &tr->tr_flags)); in log_refund()
895 sdp->sd_log_tr = tr; in log_refund()
896 set_bit(TR_ATTACHED, &tr->tr_flags); in log_refund()
899 sdp->sd_log_commited_revoke += tr->tr_num_revoke - tr->tr_num_revoke_rm; in log_refund()
901 maxres = sdp->sd_log_blks_reserved + tr->tr_reserved; in log_refund()
928 void gfs2_log_commit(struct gfs2_sbd *sdp, struct gfs2_trans *tr) in gfs2_log_commit() argument
930 log_refund(sdp, tr); in gfs2_log_commit()