Lines Matching refs:tr

102 			       struct gfs2_trans *tr, struct blk_plug *plug)  in gfs2_ail1_start_one()  argument
112 list_for_each_entry_safe_reverse(bd, s, &tr->tr_ail1_list, bd_ail_st_list) { in gfs2_ail1_start_one()
115 gfs2_assert(sdp, bd->bd_tr == tr); in gfs2_ail1_start_one()
120 &tr->tr_ail2_list); in gfs2_ail1_start_one()
138 list_move(&bd->bd_ail_st_list, &tr->tr_ail1_list); in gfs2_ail1_start_one()
162 struct gfs2_trans *tr; in dump_ail_list() local
166 list_for_each_entry_reverse(tr, &sdp->sd_ail1_list, tr_list) { in dump_ail_list()
167 list_for_each_entry_reverse(bd, &tr->tr_ail1_list, in dump_ail_list()
204 struct gfs2_trans *tr; in gfs2_ail1_flush() local
220 list_for_each_entry_reverse(tr, head, tr_list) { in gfs2_ail1_flush()
223 ret = gfs2_ail1_start_one(sdp, wbc, tr, &plug); in gfs2_ail1_flush()
260 struct gfs2_trans *tr; in gfs2_log_update_flush_tail() local
263 tr = list_last_entry(&sdp->sd_ail1_list, in gfs2_log_update_flush_tail()
265 new_flush_tail = tr->tr_first; in gfs2_log_update_flush_tail()
283 static void gfs2_ail_empty_tr(struct gfs2_sbd *sdp, struct gfs2_trans *tr, in gfs2_ail_empty_tr() argument
291 gfs2_assert(sdp, bd->bd_tr == tr); in gfs2_ail_empty_tr()
305 static int gfs2_ail1_empty_one(struct gfs2_sbd *sdp, struct gfs2_trans *tr, in gfs2_ail1_empty_one() argument
312 list_for_each_entry_safe_reverse(bd, s, &tr->tr_ail1_list, in gfs2_ail1_empty_one()
315 gfs2_assert(sdp, bd->bd_tr == tr); in gfs2_ail1_empty_one()
345 list_move(&bd->bd_ail_st_list, &tr->tr_ail2_list); in gfs2_ail1_empty_one()
360 struct gfs2_trans *tr, *s; in gfs2_ail1_empty() local
365 list_for_each_entry_safe_reverse(tr, s, &sdp->sd_ail1_list, tr_list) { in gfs2_ail1_empty()
366 if (!gfs2_ail1_empty_one(sdp, tr, &max_revokes) && oldest_tr) in gfs2_ail1_empty()
367 list_move(&tr->tr_list, &sdp->sd_ail2_list); in gfs2_ail1_empty()
385 struct gfs2_trans *tr; in gfs2_ail1_wait() local
390 list_for_each_entry_reverse(tr, &sdp->sd_ail1_list, tr_list) { in gfs2_ail1_wait()
391 list_for_each_entry(bd, &tr->tr_ail1_list, bd_ail_st_list) { in gfs2_ail1_wait()
405 static void __ail2_empty(struct gfs2_sbd *sdp, struct gfs2_trans *tr) in __ail2_empty() argument
407 gfs2_ail_empty_tr(sdp, tr, &tr->tr_ail2_list); in __ail2_empty()
408 list_del(&tr->tr_list); in __ail2_empty()
409 gfs2_assert_warn(sdp, list_empty(&tr->tr_ail1_list)); in __ail2_empty()
410 gfs2_assert_warn(sdp, list_empty(&tr->tr_ail2_list)); in __ail2_empty()
411 gfs2_trans_free(sdp, tr); in __ail2_empty()
418 struct gfs2_trans *tr, *safe; in ail2_empty() local
422 list_for_each_entry_safe(tr, safe, ail2_list, tr_list) { in ail2_empty()
423 if (old_tail <= tr->tr_first && tr->tr_first < new_tail) in ail2_empty()
424 __ail2_empty(sdp, tr); in ail2_empty()
427 list_for_each_entry_safe(tr, safe, ail2_list, tr_list) { in ail2_empty()
428 if (old_tail <= tr->tr_first || tr->tr_first < new_tail) in ail2_empty()
429 __ail2_empty(sdp, tr); in ail2_empty()
569 bool gfs2_log_try_reserve(struct gfs2_sbd *sdp, struct gfs2_trans *tr, in gfs2_log_try_reserve() argument
572 unsigned int blks = tr->tr_reserved; in gfs2_log_try_reserve()
573 unsigned int revokes = tr->tr_revokes; in gfs2_log_try_reserve()
600 void gfs2_log_reserve(struct gfs2_sbd *sdp, struct gfs2_trans *tr, in gfs2_log_reserve() argument
603 unsigned int blks = tr->tr_reserved; in gfs2_log_reserve()
604 unsigned int revokes = tr->tr_revokes; in gfs2_log_reserve()
665 struct gfs2_trans *tr = sdp->sd_log_tr; in calc_reserved() local
667 if (tr) { in calc_reserved()
668 blocks = tr->tr_num_buf_new - tr->tr_num_buf_rm; in calc_reserved()
670 blocks = tr->tr_num_databuf_new - tr->tr_num_databuf_rm; in calc_reserved()
941 struct gfs2_trans *tr; in gfs2_ail_drain() local
952 tr = list_first_entry(&sdp->sd_ail1_list, struct gfs2_trans, in gfs2_ail_drain()
954 gfs2_ail_empty_tr(sdp, tr, &tr->tr_ail1_list); in gfs2_ail_drain()
955 gfs2_ail_empty_tr(sdp, tr, &tr->tr_ail2_list); in gfs2_ail_drain()
956 list_del(&tr->tr_list); in gfs2_ail_drain()
957 gfs2_trans_free(sdp, tr); in gfs2_ail_drain()
960 tr = list_first_entry(&sdp->sd_ail2_list, struct gfs2_trans, in gfs2_ail_drain()
962 gfs2_ail_empty_tr(sdp, tr, &tr->tr_ail2_list); in gfs2_ail_drain()
963 list_del(&tr->tr_list); in gfs2_ail_drain()
964 gfs2_trans_free(sdp, tr); in gfs2_ail_drain()
1000 static void trans_drain(struct gfs2_trans *tr) in trans_drain() argument
1005 if (!tr) in trans_drain()
1008 head = &tr->tr_buf; in trans_drain()
1016 head = &tr->tr_databuf; in trans_drain()
1036 struct gfs2_trans *tr = NULL; in gfs2_log_flush() local
1061 tr = sdp->sd_log_tr; in gfs2_log_flush()
1062 if (tr || sdp->sd_log_num_revoke) { in gfs2_log_flush()
1067 if (tr) { in gfs2_log_flush()
1069 tr->tr_first = first_log_head; in gfs2_log_flush()
1072 !tr->tr_num_buf_new && !tr->tr_num_databuf_new)) in gfs2_log_flush()
1102 lops_before_commit(sdp, tr); in gfs2_log_flush()
1116 lops_after_commit(sdp, tr); in gfs2_log_flush()
1122 if (tr && !list_empty(&tr->tr_ail1_list)) { in gfs2_log_flush()
1123 list_add(&tr->tr_list, &sdp->sd_ail1_list); in gfs2_log_flush()
1124 tr = NULL; in gfs2_log_flush()
1154 gfs2_trans_free(sdp, tr); in gfs2_log_flush()
1161 trans_drain(tr); in gfs2_log_flush()
1169 if (tr && list_empty(&tr->tr_list)) in gfs2_log_flush()
1170 list_add(&tr->tr_list, &sdp->sd_ail1_list); in gfs2_log_flush()
1172 tr = NULL; in gfs2_log_flush()
1204 static void log_refund(struct gfs2_sbd *sdp, struct gfs2_trans *tr) in log_refund() argument
1213 gfs2_merge_trans(sdp, tr); in log_refund()
1214 } else if (tr->tr_num_buf_new || tr->tr_num_databuf_new) { in log_refund()
1215 gfs2_assert_withdraw(sdp, !test_bit(TR_ONSTACK, &tr->tr_flags)); in log_refund()
1216 sdp->sd_log_tr = tr; in log_refund()
1217 set_bit(TR_ATTACHED, &tr->tr_flags); in log_refund()
1221 maxres = sdp->sd_log_blks_reserved + tr->tr_reserved; in log_refund()
1261 void gfs2_log_commit(struct gfs2_sbd *sdp, struct gfs2_trans *tr) in gfs2_log_commit() argument
1263 log_refund(sdp, tr); in gfs2_log_commit()