DM9000: Add ethtool control of msg_enable value
[safe/jmp/linux-2.6] / fs / gfs2 / trans.c
index eadf96e..73e5d92 100644 (file)
@@ -114,11 +114,6 @@ void gfs2_trans_end(struct gfs2_sbd *sdp)
                gfs2_log_flush(sdp, NULL);
 }
 
-void gfs2_trans_add_gl(struct gfs2_glock *gl)
-{
-       lops_add(gl->gl_sbd, &gl->gl_le);
-}
-
 /**
  * gfs2_trans_add_bh - Add a to-be-modified buffer to the current transaction
  * @gl: the glock the buffer belongs to
@@ -142,12 +137,12 @@ void gfs2_trans_add_bh(struct gfs2_glock *gl, struct buffer_head *bh, int meta)
        lops_add(sdp, &bd->bd_le);
 }
 
-void gfs2_trans_add_revoke(struct gfs2_sbd *sdp, u64 blkno)
+void gfs2_trans_add_revoke(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd)
 {
-       struct gfs2_bufdata *bd = kmalloc(sizeof(struct gfs2_bufdata),
-                                         GFP_NOFS | __GFP_NOFAIL);
+       BUG_ON(!list_empty(&bd->bd_le.le_list));
+       BUG_ON(!list_empty(&bd->bd_ail_st_list));
+       BUG_ON(!list_empty(&bd->bd_ail_gl_list));
        lops_init_le(&bd->bd_le, &gfs2_revoke_lops);
-       bd->bd_blkno = blkno;
        lops_add(sdp, &bd->bd_le);
 }
 
@@ -160,7 +155,7 @@ void gfs2_trans_add_unrevoke(struct gfs2_sbd *sdp, u64 blkno)
 
        list_for_each_entry(bd, &sdp->sd_log_le_revoke, bd_le.le_list) {
                if (bd->bd_blkno == blkno) {
-                       list_del(&bd->bd_le.le_list);
+                       list_del_init(&bd->bd_le.le_list);
                        gfs2_assert_withdraw(sdp, sdp->sd_log_num_revoke);
                        sdp->sd_log_num_revoke--;
                        found = 1;
@@ -172,7 +167,7 @@ void gfs2_trans_add_unrevoke(struct gfs2_sbd *sdp, u64 blkno)
 
        if (found) {
                struct gfs2_trans *tr = current->journal_info;
-               kfree(bd);
+               kmem_cache_free(gfs2_bufdata_cachep, bd);
                tr->tr_num_revoke_rm++;
        }
 }