diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2012-12-14 07:29:56 -0500 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2013-01-29 05:27:46 -0500 |
commit | 75f2b879aeb3158daf6aa95d135803f7e71df06b (patch) | |
tree | 30bf176b742d11a4e71f2f0a1e3495f45e337a75 /fs/gfs2 | |
parent | 2a005855938235771b6960206d7581a4933cf6b7 (diff) |
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>
Diffstat (limited to 'fs/gfs2')
-rw-r--r-- | fs/gfs2/lops.c | 15 | ||||
-rw-r--r-- | fs/gfs2/trans.c | 10 |
2 files changed, 9 insertions, 16 deletions
diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c index 9ceccb1595a3..9c8074223461 100644 --- a/fs/gfs2/lops.c +++ b/fs/gfs2/lops.c | |||
@@ -600,20 +600,6 @@ static void buf_lo_after_scan(struct gfs2_jdesc *jd, int error, int pass) | |||
600 | jd->jd_jid, sdp->sd_replayed_blocks, sdp->sd_found_blocks); | 600 | jd->jd_jid, sdp->sd_replayed_blocks, sdp->sd_found_blocks); |
601 | } | 601 | } |
602 | 602 | ||
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 | |||
617 | static void revoke_lo_before_commit(struct gfs2_sbd *sdp) | 603 | static void revoke_lo_before_commit(struct gfs2_sbd *sdp) |
618 | { | 604 | { |
619 | struct gfs2_meta_header *mh; | 605 | struct gfs2_meta_header *mh; |
@@ -895,7 +881,6 @@ const struct gfs2_log_operations gfs2_buf_lops = { | |||
895 | }; | 881 | }; |
896 | 882 | ||
897 | const struct gfs2_log_operations gfs2_revoke_lops = { | 883 | const struct gfs2_log_operations gfs2_revoke_lops = { |
898 | .lo_add = revoke_lo_add, | ||
899 | .lo_before_commit = revoke_lo_before_commit, | 884 | .lo_before_commit = revoke_lo_before_commit, |
900 | .lo_after_commit = revoke_lo_after_commit, | 885 | .lo_after_commit = revoke_lo_after_commit, |
901 | .lo_before_scan = revoke_lo_before_scan, | 886 | .lo_before_scan = revoke_lo_before_scan, |
diff --git a/fs/gfs2/trans.c b/fs/gfs2/trans.c index 413627072f36..6f3ddbcb5cc9 100644 --- a/fs/gfs2/trans.c +++ b/fs/gfs2/trans.c | |||
@@ -175,11 +175,19 @@ void gfs2_trans_add_bh(struct gfs2_glock *gl, struct buffer_head *bh, int meta) | |||
175 | 175 | ||
176 | void gfs2_trans_add_revoke(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd) | 176 | void gfs2_trans_add_revoke(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd) |
177 | { | 177 | { |
178 | struct gfs2_glock *gl = bd->bd_gl; | ||
179 | struct gfs2_trans *tr = current->journal_info; | ||
180 | |||
178 | BUG_ON(!list_empty(&bd->bd_list)); | 181 | BUG_ON(!list_empty(&bd->bd_list)); |
179 | BUG_ON(!list_empty(&bd->bd_ail_st_list)); | 182 | BUG_ON(!list_empty(&bd->bd_ail_st_list)); |
180 | BUG_ON(!list_empty(&bd->bd_ail_gl_list)); | 183 | BUG_ON(!list_empty(&bd->bd_ail_gl_list)); |
181 | lops_init_le(bd, &gfs2_revoke_lops); | 184 | 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); | ||
183 | } | 191 | } |
184 | 192 | ||
185 | void gfs2_trans_add_unrevoke(struct gfs2_sbd *sdp, u64 blkno, unsigned int len) | 193 | void gfs2_trans_add_unrevoke(struct gfs2_sbd *sdp, u64 blkno, unsigned int len) |