Skip to content

Commit 75f2b87

Browse files
committed
GFS2: Merge revoke adding functions
This moves the lo_add function for revokes into trans.c, removing a function call and making the code easier to read. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
1 parent 2a00585 commit 75f2b87

2 files changed

Lines changed: 9 additions & 16 deletions

File tree

‎fs/gfs2/lops.c‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -600,20 +600,6 @@ static void buf_lo_after_scan(struct gfs2_jdesc *jd, int error, int pass)
600600
jd->jd_jid, sdp->sd_replayed_blocks, sdp->sd_found_blocks);
601601
}
602602

603-
static void revoke_lo_add(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd)
604-
{
605-
struct gfs2_glock *gl = bd->bd_gl;
606-
struct gfs2_trans *tr;
607-
608-
tr = current->journal_info;
609-
tr->tr_touched = 1;
610-
tr->tr_num_revoke++;
611-
sdp->sd_log_num_revoke++;
612-
atomic_inc(&gl->gl_revokes);
613-
set_bit(GLF_LFLUSH, &gl->gl_flags);
614-
list_add(&bd->bd_list, &sdp->sd_log_le_revoke);
615-
}
616-
617603
static void revoke_lo_before_commit(struct gfs2_sbd *sdp)
618604
{
619605
struct gfs2_meta_header *mh;
@@ -895,7 +881,6 @@ const struct gfs2_log_operations gfs2_buf_lops = {
895881
};
896882

897883
const struct gfs2_log_operations gfs2_revoke_lops = {
898-
.lo_add = revoke_lo_add,
899884
.lo_before_commit = revoke_lo_before_commit,
900885
.lo_after_commit = revoke_lo_after_commit,
901886
.lo_before_scan = revoke_lo_before_scan,

‎fs/gfs2/trans.c‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,19 @@ void gfs2_trans_add_bh(struct gfs2_glock *gl, struct buffer_head *bh, int meta)
175175

176176
void gfs2_trans_add_revoke(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd)
177177
{
178+
struct gfs2_glock *gl = bd->bd_gl;
179+
struct gfs2_trans *tr = current->journal_info;
180+
178181
BUG_ON(!list_empty(&bd->bd_list));
179182
BUG_ON(!list_empty(&bd->bd_ail_st_list));
180183
BUG_ON(!list_empty(&bd->bd_ail_gl_list));
181184
lops_init_le(bd, &gfs2_revoke_lops);
182-
lops_add(sdp, bd);
185+
tr->tr_touched = 1;
186+
tr->tr_num_revoke++;
187+
sdp->sd_log_num_revoke++;
188+
atomic_inc(&gl->gl_revokes);
189+
set_bit(GLF_LFLUSH, &gl->gl_flags);
190+
list_add(&bd->bd_list, &sdp->sd_log_le_revoke);
183191
}
184192

185193
void gfs2_trans_add_unrevoke(struct gfs2_sbd *sdp, u64 blkno, unsigned int len)

0 commit comments

Comments
 (0)