Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 38630
b: refs/heads/master
c: e317ffc
h: refs/heads/master
v: v3
  • Loading branch information
Steven Whitehouse committed Mar 1, 2006
1 parent 49fa2de commit f47a353
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b3f58d8f2b1200f1b9abbcfb9dec6c25bc787469
refs/heads/master: e317ffcb7cc26c5e80cab97160a5e2761a4436ec
2 changes: 1 addition & 1 deletion trunk/fs/gfs2/incore.h
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ struct gfs2_trans {
unsigned int tr_revokes;
unsigned int tr_reserved;

struct gfs2_holder *tr_t_gh;
struct gfs2_holder tr_t_gh;

int tr_touched;

Expand Down
30 changes: 12 additions & 18 deletions trunk/fs/gfs2/trans.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,15 @@ int gfs2_trans_begin_i(struct gfs2_sbd *sdp, unsigned int blocks,
sizeof(uint64_t));
INIT_LIST_HEAD(&tr->tr_list_buf);

error = -ENOMEM;
tr->tr_t_gh = gfs2_holder_get(sdp->sd_trans_gl, LM_ST_SHARED,
GL_NEVER_RECURSE, GFP_NOFS);
if (!tr->tr_t_gh)
goto fail;
gfs2_holder_init(sdp->sd_trans_gl, LM_ST_SHARED,
GL_NEVER_RECURSE, &tr->tr_t_gh);

error = gfs2_glock_nq(tr->tr_t_gh);
error = gfs2_glock_nq(&tr->tr_t_gh);
if (error)
goto fail_holder_put;
goto fail_holder_uninit;

if (!test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags)) {
tr->tr_t_gh->gh_flags |= GL_NOCACHE;
tr->tr_t_gh.gh_flags |= GL_NOCACHE;
error = -EROFS;
goto fail_gunlock;
}
Expand All @@ -78,12 +75,10 @@ int gfs2_trans_begin_i(struct gfs2_sbd *sdp, unsigned int blocks,
return 0;

fail_gunlock:
gfs2_glock_dq(tr->tr_t_gh);
gfs2_glock_dq(&tr->tr_t_gh);

fail_holder_put:
gfs2_holder_put(tr->tr_t_gh);

fail:
fail_holder_uninit:
gfs2_holder_uninit(&tr->tr_t_gh);
kfree(tr);

return error;
Expand All @@ -100,16 +95,15 @@ void gfs2_trans_end(struct gfs2_sbd *sdp)
if (gfs2_assert_warn(sdp, tr))
return;

t_gh = tr->tr_t_gh;
tr->tr_t_gh = NULL;
t_gh = &tr->tr_t_gh;

if (!tr->tr_touched) {
gfs2_log_release(sdp, tr->tr_reserved);
kfree(tr);

gfs2_glock_dq(t_gh);
gfs2_holder_put(t_gh);
gfs2_holder_uninit(t_gh);

kfree(tr);
return;
}

Expand All @@ -127,7 +121,7 @@ void gfs2_trans_end(struct gfs2_sbd *sdp)
gfs2_log_commit(sdp, tr);

gfs2_glock_dq(t_gh);
gfs2_holder_put(t_gh);
gfs2_holder_uninit(t_gh);

if (sdp->sd_vfs->s_flags & MS_SYNCHRONOUS)
gfs2_log_flush(sdp);
Expand Down

0 comments on commit f47a353

Please sign in to comment.