Lines Matching refs:tr
34 struct gfs2_trans *tr; in gfs2_trans_begin() local
43 tr = kzalloc(sizeof(struct gfs2_trans), GFP_NOFS); in gfs2_trans_begin()
44 if (!tr) in gfs2_trans_begin()
47 tr->tr_ip = _RET_IP_; in gfs2_trans_begin()
48 tr->tr_blocks = blocks; in gfs2_trans_begin()
49 tr->tr_revokes = revokes; in gfs2_trans_begin()
50 tr->tr_reserved = 1; in gfs2_trans_begin()
51 tr->tr_alloced = 1; in gfs2_trans_begin()
53 tr->tr_reserved += 6 + blocks; in gfs2_trans_begin()
55 tr->tr_reserved += gfs2_struct2blk(sdp, revokes, in gfs2_trans_begin()
57 INIT_LIST_HEAD(&tr->tr_databuf); in gfs2_trans_begin()
58 INIT_LIST_HEAD(&tr->tr_buf); in gfs2_trans_begin()
62 error = gfs2_log_reserve(sdp, tr->tr_reserved); in gfs2_trans_begin()
66 current->journal_info = tr; in gfs2_trans_begin()
72 kfree(tr); in gfs2_trans_begin()
77 static void gfs2_print_trans(const struct gfs2_trans *tr) in gfs2_print_trans() argument
79 pr_warn("Transaction created at: %pSR\n", (void *)tr->tr_ip); in gfs2_print_trans()
81 tr->tr_blocks, tr->tr_revokes, tr->tr_reserved, tr->tr_touched); in gfs2_print_trans()
83 tr->tr_num_buf_new, tr->tr_num_buf_rm, in gfs2_print_trans()
84 tr->tr_num_databuf_new, tr->tr_num_databuf_rm, in gfs2_print_trans()
85 tr->tr_num_revoke, tr->tr_num_revoke_rm); in gfs2_print_trans()
90 struct gfs2_trans *tr = current->journal_info; in gfs2_trans_end() local
92 int alloced = tr->tr_alloced; in gfs2_trans_end()
94 BUG_ON(!tr); in gfs2_trans_end()
97 if (!tr->tr_touched) { in gfs2_trans_end()
98 gfs2_log_release(sdp, tr->tr_reserved); in gfs2_trans_end()
100 kfree(tr); in gfs2_trans_end()
106 nbuf = tr->tr_num_buf_new + tr->tr_num_databuf_new; in gfs2_trans_end()
107 nbuf -= tr->tr_num_buf_rm; in gfs2_trans_end()
108 nbuf -= tr->tr_num_databuf_rm; in gfs2_trans_end()
110 if (gfs2_assert_withdraw(sdp, (nbuf <= tr->tr_blocks) && in gfs2_trans_end()
111 (tr->tr_num_revoke <= tr->tr_revokes))) in gfs2_trans_end()
112 gfs2_print_trans(tr); in gfs2_trans_end()
114 gfs2_log_commit(sdp, tr); in gfs2_trans_end()
115 if (alloced && !tr->tr_attached) in gfs2_trans_end()
116 kfree(tr); in gfs2_trans_end()
160 struct gfs2_trans *tr = current->journal_info; in gfs2_trans_add_data() local
183 tr->tr_touched = 1; in gfs2_trans_add_data()
188 tr->tr_num_databuf_new++; in gfs2_trans_add_data()
189 list_add_tail(&bd->bd_list, &tr->tr_databuf); in gfs2_trans_add_data()
198 struct gfs2_trans *tr; in meta_lo_add() local
201 tr = current->journal_info; in meta_lo_add()
202 tr->tr_touched = 1; in meta_lo_add()
220 list_add(&bd->bd_list, &tr->tr_buf); in meta_lo_add()
221 tr->tr_num_buf_new++; in meta_lo_add()
251 struct gfs2_trans *tr = current->journal_info; in gfs2_trans_add_revoke() local
255 tr->tr_touched = 1; in gfs2_trans_add_revoke()
256 tr->tr_num_revoke++; in gfs2_trans_add_revoke()
262 struct gfs2_trans *tr = current->journal_info; in gfs2_trans_add_unrevoke() local
272 tr->tr_num_revoke_rm++; in gfs2_trans_add_unrevoke()