aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/trans.c
diff options
context:
space:
mode:
authorBob Peterson <rpeterso@redhat.com>2012-05-01 12:00:34 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2012-05-02 04:14:36 -0400
commitc0752aa7e4d48cc19e167ccb0092bea8e5b6ca3a (patch)
tree2ff43322a35871364f9be2c2e4a6427db7db8a0f /fs/gfs2/trans.c
parent1c47f09592148ba629edb2020d4dd94f81b16d11 (diff)
GFS2: eliminate log elements and simplify
This patch eliminates the gfs2_log_element data structure and rolls its two components into the gfs2_bufdata. This makes the code easier to understand and makes it easier to migrate to a rbtree to keep the list sorted. Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/trans.c')
-rw-r--r--fs/gfs2/trans.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/gfs2/trans.c b/fs/gfs2/trans.c
index 8fb631769172..ad3e2fb763d7 100644
--- a/fs/gfs2/trans.c
+++ b/fs/gfs2/trans.c
@@ -158,16 +158,16 @@ void gfs2_trans_add_bh(struct gfs2_glock *gl, struct buffer_head *bh, int meta)
158 gfs2_attach_bufdata(gl, bh, meta); 158 gfs2_attach_bufdata(gl, bh, meta);
159 bd = bh->b_private; 159 bd = bh->b_private;
160 } 160 }
161 lops_add(sdp, &bd->bd_le); 161 lops_add(sdp, bd);
162} 162}
163 163
164void gfs2_trans_add_revoke(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd) 164void gfs2_trans_add_revoke(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd)
165{ 165{
166 BUG_ON(!list_empty(&bd->bd_le.le_list)); 166 BUG_ON(!list_empty(&bd->bd_list));
167 BUG_ON(!list_empty(&bd->bd_ail_st_list)); 167 BUG_ON(!list_empty(&bd->bd_ail_st_list));
168 BUG_ON(!list_empty(&bd->bd_ail_gl_list)); 168 BUG_ON(!list_empty(&bd->bd_ail_gl_list));
169 lops_init_le(&bd->bd_le, &gfs2_revoke_lops); 169 lops_init_le(bd, &gfs2_revoke_lops);
170 lops_add(sdp, &bd->bd_le); 170 lops_add(sdp, bd);
171} 171}
172 172
173void gfs2_trans_add_unrevoke(struct gfs2_sbd *sdp, u64 blkno, unsigned int len) 173void gfs2_trans_add_unrevoke(struct gfs2_sbd *sdp, u64 blkno, unsigned int len)
@@ -177,9 +177,9 @@ void gfs2_trans_add_unrevoke(struct gfs2_sbd *sdp, u64 blkno, unsigned int len)
177 unsigned int n = len; 177 unsigned int n = len;
178 178
179 gfs2_log_lock(sdp); 179 gfs2_log_lock(sdp);
180 list_for_each_entry_safe(bd, tmp, &sdp->sd_log_le_revoke, bd_le.le_list) { 180 list_for_each_entry_safe(bd, tmp, &sdp->sd_log_le_revoke, bd_list) {
181 if ((bd->bd_blkno >= blkno) && (bd->bd_blkno < (blkno + len))) { 181 if ((bd->bd_blkno >= blkno) && (bd->bd_blkno < (blkno + len))) {
182 list_del_init(&bd->bd_le.le_list); 182 list_del_init(&bd->bd_list);
183 gfs2_assert_withdraw(sdp, sdp->sd_log_num_revoke); 183 gfs2_assert_withdraw(sdp, sdp->sd_log_num_revoke);
184 sdp->sd_log_num_revoke--; 184 sdp->sd_log_num_revoke--;
185 kmem_cache_free(gfs2_bufdata_cachep, bd); 185 kmem_cache_free(gfs2_bufdata_cachep, bd);