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()
153 struct gfs2_trans *tr; in dump_ail_list() local
157 list_for_each_entry_reverse(tr, &sdp->sd_ail1_list, tr_list) { in dump_ail_list()
158 list_for_each_entry_reverse(bd, &tr->tr_ail1_list, in dump_ail_list()
195 struct gfs2_trans *tr; in gfs2_ail1_flush() local
211 list_for_each_entry_reverse(tr, head, tr_list) { in gfs2_ail1_flush()
214 ret = gfs2_ail1_start_one(sdp, wbc, tr, &plug); in gfs2_ail1_flush()
251 struct gfs2_trans *tr; in gfs2_log_update_flush_tail() local
254 tr = list_last_entry(&sdp->sd_ail1_list, in gfs2_log_update_flush_tail()
256 new_flush_tail = tr->tr_first; in gfs2_log_update_flush_tail()
274 static void gfs2_ail_empty_tr(struct gfs2_sbd *sdp, struct gfs2_trans *tr, in gfs2_ail_empty_tr() argument
282 gfs2_assert(sdp, bd->bd_tr == tr); in gfs2_ail_empty_tr()
296 static int gfs2_ail1_empty_one(struct gfs2_sbd *sdp, struct gfs2_trans *tr, in gfs2_ail1_empty_one() argument
303 list_for_each_entry_safe_reverse(bd, s, &tr->tr_ail1_list, in gfs2_ail1_empty_one()
306 gfs2_assert(sdp, bd->bd_tr == tr); in gfs2_ail1_empty_one()
336 list_move(&bd->bd_ail_st_list, &tr->tr_ail2_list); in gfs2_ail1_empty_one()
351 struct gfs2_trans *tr, *s; in gfs2_ail1_empty() local
356 list_for_each_entry_safe_reverse(tr, s, &sdp->sd_ail1_list, tr_list) { in gfs2_ail1_empty()
357 if (!gfs2_ail1_empty_one(sdp, tr, &max_revokes) && oldest_tr) in gfs2_ail1_empty()
358 list_move(&tr->tr_list, &sdp->sd_ail2_list); in gfs2_ail1_empty()
376 struct gfs2_trans *tr; in gfs2_ail1_wait() local
381 list_for_each_entry_reverse(tr, &sdp->sd_ail1_list, tr_list) { in gfs2_ail1_wait()
382 list_for_each_entry(bd, &tr->tr_ail1_list, bd_ail_st_list) { in gfs2_ail1_wait()
396 static void __ail2_empty(struct gfs2_sbd *sdp, struct gfs2_trans *tr) in __ail2_empty() argument
398 gfs2_ail_empty_tr(sdp, tr, &tr->tr_ail2_list); in __ail2_empty()
399 list_del(&tr->tr_list); in __ail2_empty()
400 gfs2_assert_warn(sdp, list_empty(&tr->tr_ail1_list)); in __ail2_empty()
401 gfs2_assert_warn(sdp, list_empty(&tr->tr_ail2_list)); in __ail2_empty()
402 gfs2_trans_free(sdp, tr); in __ail2_empty()
409 struct gfs2_trans *tr, *safe; in ail2_empty() local
413 list_for_each_entry_safe(tr, safe, ail2_list, tr_list) { in ail2_empty()
414 if (old_tail <= tr->tr_first && tr->tr_first < new_tail) in ail2_empty()
415 __ail2_empty(sdp, tr); in ail2_empty()
418 list_for_each_entry_safe(tr, safe, ail2_list, tr_list) { in ail2_empty()
419 if (old_tail <= tr->tr_first || tr->tr_first < new_tail) in ail2_empty()
420 __ail2_empty(sdp, tr); in ail2_empty()
560 bool gfs2_log_try_reserve(struct gfs2_sbd *sdp, struct gfs2_trans *tr, in gfs2_log_try_reserve() argument
563 unsigned int blks = tr->tr_reserved; in gfs2_log_try_reserve()
564 unsigned int revokes = tr->tr_revokes; in gfs2_log_try_reserve()
591 void gfs2_log_reserve(struct gfs2_sbd *sdp, struct gfs2_trans *tr, in gfs2_log_reserve() argument
594 unsigned int blks = tr->tr_reserved; in gfs2_log_reserve()
595 unsigned int revokes = tr->tr_revokes; in gfs2_log_reserve()
656 struct gfs2_trans *tr = sdp->sd_log_tr; in calc_reserved() local
658 if (tr) { in calc_reserved()
659 blocks = tr->tr_num_buf_new - tr->tr_num_buf_rm; in calc_reserved()
661 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()
992 static void trans_drain(struct gfs2_trans *tr) in trans_drain() argument
997 if (!tr) in trans_drain()
1000 head = &tr->tr_buf; in trans_drain()
1008 head = &tr->tr_databuf; in trans_drain()
1028 struct gfs2_trans *tr = NULL; in gfs2_log_flush() local
1052 tr = sdp->sd_log_tr; in gfs2_log_flush()
1053 if (tr || sdp->sd_log_num_revoke) { in gfs2_log_flush()
1058 if (tr) { in gfs2_log_flush()
1060 tr->tr_first = first_log_head; in gfs2_log_flush()
1063 !tr->tr_num_buf_new && !tr->tr_num_databuf_new)) in gfs2_log_flush()
1093 lops_before_commit(sdp, tr); in gfs2_log_flush()
1107 lops_after_commit(sdp, tr); in gfs2_log_flush()
1113 if (tr && !list_empty(&tr->tr_ail1_list)) { in gfs2_log_flush()
1114 list_add(&tr->tr_list, &sdp->sd_ail1_list); in gfs2_log_flush()
1115 tr = NULL; in gfs2_log_flush()
1147 gfs2_trans_free(sdp, tr); in gfs2_log_flush()
1154 trans_drain(tr); in gfs2_log_flush()
1162 if (tr && list_empty(&tr->tr_list)) in gfs2_log_flush()
1163 list_add(&tr->tr_list, &sdp->sd_ail1_list); in gfs2_log_flush()
1165 tr = NULL; in gfs2_log_flush()
1197 static void log_refund(struct gfs2_sbd *sdp, struct gfs2_trans *tr) in log_refund() argument
1206 gfs2_merge_trans(sdp, tr); in log_refund()
1207 } else if (tr->tr_num_buf_new || tr->tr_num_databuf_new) { in log_refund()
1208 gfs2_assert_withdraw(sdp, !test_bit(TR_ONSTACK, &tr->tr_flags)); in log_refund()
1209 sdp->sd_log_tr = tr; in log_refund()
1210 set_bit(TR_ATTACHED, &tr->tr_flags); in log_refund()
1214 maxres = sdp->sd_log_blks_reserved + tr->tr_reserved; in log_refund()
1239 void gfs2_log_commit(struct gfs2_sbd *sdp, struct gfs2_trans *tr) in gfs2_log_commit() argument
1241 log_refund(sdp, tr); in gfs2_log_commit()