aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/glops.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2/glops.c')
-rw-r--r--fs/gfs2/glops.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c
index f07ede8cb9ba..a9b7d3a60081 100644
--- a/fs/gfs2/glops.c
+++ b/fs/gfs2/glops.c
@@ -37,20 +37,25 @@
37static void gfs2_ail_empty_gl(struct gfs2_glock *gl) 37static void gfs2_ail_empty_gl(struct gfs2_glock *gl)
38{ 38{
39 struct gfs2_sbd *sdp = gl->gl_sbd; 39 struct gfs2_sbd *sdp = gl->gl_sbd;
40 unsigned int blocks;
41 struct list_head *head = &gl->gl_ail_list; 40 struct list_head *head = &gl->gl_ail_list;
42 struct gfs2_bufdata *bd; 41 struct gfs2_bufdata *bd;
43 struct buffer_head *bh; 42 struct buffer_head *bh;
44 int error; 43 struct gfs2_trans tr;
45 44
46 blocks = atomic_read(&gl->gl_ail_count); 45 memset(&tr, 0, sizeof(tr));
47 if (!blocks) 46 tr.tr_revokes = atomic_read(&gl->gl_ail_count);
48 return;
49 47
50 error = gfs2_trans_begin(sdp, 0, blocks); 48 if (!tr.tr_revokes)
51 if (gfs2_assert_withdraw(sdp, !error))
52 return; 49 return;
53 50
51 /* A shortened, inline version of gfs2_trans_begin() */
52 tr.tr_reserved = 1 + gfs2_struct2blk(sdp, tr.tr_revokes, sizeof(u64));
53 tr.tr_ip = (unsigned long)__builtin_return_address(0);
54 INIT_LIST_HEAD(&tr.tr_list_buf);
55 gfs2_log_reserve(sdp, tr.tr_reserved);
56 BUG_ON(current->journal_info);
57 current->journal_info = &tr;
58
54 gfs2_log_lock(sdp); 59 gfs2_log_lock(sdp);
55 while (!list_empty(head)) { 60 while (!list_empty(head)) {
56 bd = list_entry(head->next, struct gfs2_bufdata, 61 bd = list_entry(head->next, struct gfs2_bufdata,