Lines Matching refs:tr

93 			       struct gfs2_trans *tr, struct blk_plug *plug)  in gfs2_ail1_start_one()  argument
103 list_for_each_entry_safe_reverse(bd, s, &tr->tr_ail1_list, bd_ail_st_list) { in gfs2_ail1_start_one()
106 gfs2_assert(sdp, bd->bd_tr == tr); in gfs2_ail1_start_one()
111 &tr->tr_ail2_list); in gfs2_ail1_start_one()
129 list_move(&bd->bd_ail_st_list, &tr->tr_ail1_list); in gfs2_ail1_start_one()
154 struct gfs2_trans *tr; in dump_ail_list() local
158 list_for_each_entry_reverse(tr, &sdp->sd_ail1_list, tr_list) { in dump_ail_list()
159 list_for_each_entry_reverse(bd, &tr->tr_ail1_list, in dump_ail_list()
196 struct gfs2_trans *tr; in gfs2_ail1_flush() local
212 list_for_each_entry_reverse(tr, head, tr_list) { in gfs2_ail1_flush()
215 ret = gfs2_ail1_start_one(sdp, wbc, tr, &plug); in gfs2_ail1_flush()
252 struct gfs2_trans *tr; in gfs2_log_update_flush_tail() local
255 tr = list_last_entry(&sdp->sd_ail1_list, in gfs2_log_update_flush_tail()
257 new_flush_tail = tr->tr_first; in gfs2_log_update_flush_tail()
275 static void gfs2_ail_empty_tr(struct gfs2_sbd *sdp, struct gfs2_trans *tr, in gfs2_ail_empty_tr() argument
283 gfs2_assert(sdp, bd->bd_tr == tr); in gfs2_ail_empty_tr()
297 static int gfs2_ail1_empty_one(struct gfs2_sbd *sdp, struct gfs2_trans *tr, in gfs2_ail1_empty_one() argument
304 list_for_each_entry_safe_reverse(bd, s, &tr->tr_ail1_list, in gfs2_ail1_empty_one()
307 gfs2_assert(sdp, bd->bd_tr == tr); in gfs2_ail1_empty_one()
337 list_move(&bd->bd_ail_st_list, &tr->tr_ail2_list); in gfs2_ail1_empty_one()
353 struct gfs2_trans *tr, *s; in gfs2_ail1_empty() local
358 list_for_each_entry_safe_reverse(tr, s, &sdp->sd_ail1_list, tr_list) { in gfs2_ail1_empty()
359 if (!gfs2_ail1_empty_one(sdp, tr, &max_revokes) && oldest_tr) in gfs2_ail1_empty()
360 list_move(&tr->tr_list, &sdp->sd_ail2_list); in gfs2_ail1_empty()
373 struct gfs2_trans *tr; in gfs2_ail1_wait() local
378 list_for_each_entry_reverse(tr, &sdp->sd_ail1_list, tr_list) { in gfs2_ail1_wait()
379 list_for_each_entry(bd, &tr->tr_ail1_list, bd_ail_st_list) { in gfs2_ail1_wait()
393 static void __ail2_empty(struct gfs2_sbd *sdp, struct gfs2_trans *tr) in __ail2_empty() argument
395 gfs2_ail_empty_tr(sdp, tr, &tr->tr_ail2_list); in __ail2_empty()
396 list_del(&tr->tr_list); in __ail2_empty()
397 gfs2_assert_warn(sdp, list_empty(&tr->tr_ail1_list)); in __ail2_empty()
398 gfs2_assert_warn(sdp, list_empty(&tr->tr_ail2_list)); in __ail2_empty()
399 gfs2_trans_free(sdp, tr); in __ail2_empty()
406 struct gfs2_trans *tr, *safe; in ail2_empty() local
410 list_for_each_entry_safe(tr, safe, ail2_list, tr_list) { in ail2_empty()
411 if (old_tail <= tr->tr_first && tr->tr_first < new_tail) in ail2_empty()
412 __ail2_empty(sdp, tr); in ail2_empty()
415 list_for_each_entry_safe(tr, safe, ail2_list, tr_list) { in ail2_empty()
416 if (old_tail <= tr->tr_first || tr->tr_first < new_tail) in ail2_empty()
417 __ail2_empty(sdp, tr); in ail2_empty()
557 bool gfs2_log_try_reserve(struct gfs2_sbd *sdp, struct gfs2_trans *tr, in gfs2_log_try_reserve() argument
560 unsigned int blks = tr->tr_reserved; in gfs2_log_try_reserve()
561 unsigned int revokes = tr->tr_revokes; in gfs2_log_try_reserve()
588 void gfs2_log_reserve(struct gfs2_sbd *sdp, struct gfs2_trans *tr, in gfs2_log_reserve() argument
591 unsigned int blks = tr->tr_reserved; in gfs2_log_reserve()
592 unsigned int revokes = tr->tr_revokes; in gfs2_log_reserve()
653 struct gfs2_trans *tr = sdp->sd_log_tr; in calc_reserved() local
655 if (tr) { in calc_reserved()
656 blocks = tr->tr_num_buf_new - tr->tr_num_buf_rm; in calc_reserved()
658 blocks = tr->tr_num_databuf_new - tr->tr_num_databuf_rm; in calc_reserved()
933 struct gfs2_trans *tr; in gfs2_ail_drain() local
944 tr = list_first_entry(&sdp->sd_ail1_list, struct gfs2_trans, in gfs2_ail_drain()
946 gfs2_ail_empty_tr(sdp, tr, &tr->tr_ail1_list); in gfs2_ail_drain()
947 gfs2_ail_empty_tr(sdp, tr, &tr->tr_ail2_list); in gfs2_ail_drain()
948 list_del(&tr->tr_list); in gfs2_ail_drain()
949 gfs2_trans_free(sdp, tr); in gfs2_ail_drain()
952 tr = list_first_entry(&sdp->sd_ail2_list, struct gfs2_trans, in gfs2_ail_drain()
954 gfs2_ail_empty_tr(sdp, tr, &tr->tr_ail2_list); in gfs2_ail_drain()
955 list_del(&tr->tr_list); in gfs2_ail_drain()
956 gfs2_trans_free(sdp, tr); in gfs2_ail_drain()
998 static void trans_drain(struct gfs2_trans *tr) in trans_drain() argument
1003 if (!tr) in trans_drain()
1006 head = &tr->tr_buf; in trans_drain()
1014 head = &tr->tr_databuf; in trans_drain()
1034 struct gfs2_trans *tr = NULL; in gfs2_log_flush() local
1059 tr = sdp->sd_log_tr; in gfs2_log_flush()
1060 if (tr || sdp->sd_log_num_revoke) { in gfs2_log_flush()
1065 if (tr) { in gfs2_log_flush()
1067 tr->tr_first = first_log_head; in gfs2_log_flush()
1070 !tr->tr_num_buf_new && !tr->tr_num_databuf_new)) in gfs2_log_flush()
1100 lops_before_commit(sdp, tr); in gfs2_log_flush()
1115 lops_after_commit(sdp, tr); in gfs2_log_flush()
1121 if (tr && !list_empty(&tr->tr_ail1_list)) { in gfs2_log_flush()
1122 list_add(&tr->tr_list, &sdp->sd_ail1_list); in gfs2_log_flush()
1123 tr = NULL; in gfs2_log_flush()
1153 gfs2_trans_free(sdp, tr); in gfs2_log_flush()
1160 trans_drain(tr); in gfs2_log_flush()
1168 if (tr && list_empty(&tr->tr_list)) in gfs2_log_flush()
1169 list_add(&tr->tr_list, &sdp->sd_ail1_list); in gfs2_log_flush()
1171 tr = NULL; in gfs2_log_flush()
1203 static void log_refund(struct gfs2_sbd *sdp, struct gfs2_trans *tr) in log_refund() argument
1212 gfs2_merge_trans(sdp, tr); in log_refund()
1213 } else if (tr->tr_num_buf_new || tr->tr_num_databuf_new) { in log_refund()
1214 gfs2_assert_withdraw(sdp, !test_bit(TR_ONSTACK, &tr->tr_flags)); in log_refund()
1215 sdp->sd_log_tr = tr; in log_refund()
1216 set_bit(TR_ATTACHED, &tr->tr_flags); in log_refund()
1220 maxres = sdp->sd_log_blks_reserved + tr->tr_reserved; in log_refund()
1260 void gfs2_log_commit(struct gfs2_sbd *sdp, struct gfs2_trans *tr) in gfs2_log_commit() argument
1262 log_refund(sdp, tr); in gfs2_log_commit()