Skip to content

Commit b1ab1e4

Browse files
committed
GFS2: Remove extra "if" in gfs2_log_flush()
By reordering some of the assignments in gfs2_log_flush() it is possible to remove one of the "if" statements as it can be merged with one higher up the function. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
1 parent 47ba973 commit b1ab1e4

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

‎fs/gfs2/log.c‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -684,21 +684,19 @@ void gfs2_log_flush(struct gfs2_sbd *sdp, struct gfs2_glock *gl)
684684
}
685685
trace_gfs2_log_flush(sdp, 1);
686686

687+
sdp->sd_log_flush_head = sdp->sd_log_head;
688+
sdp->sd_log_flush_wrapped = 0;
687689
tr = sdp->sd_log_tr;
688690
if (tr) {
689691
sdp->sd_log_tr = NULL;
690692
INIT_LIST_HEAD(&tr->tr_ail1_list);
691693
INIT_LIST_HEAD(&tr->tr_ail2_list);
694+
tr->tr_first = sdp->sd_log_flush_head;
692695
}
693696

694697
gfs2_assert_withdraw(sdp,
695698
sdp->sd_log_num_revoke == sdp->sd_log_commited_revoke);
696699

697-
sdp->sd_log_flush_head = sdp->sd_log_head;
698-
sdp->sd_log_flush_wrapped = 0;
699-
if (tr)
700-
tr->tr_first = sdp->sd_log_flush_head;
701-
702700
gfs2_ordered_write(sdp);
703701
lops_before_commit(sdp, tr);
704702
gfs2_log_flush_bio(sdp, WRITE);

0 commit comments

Comments
 (0)