提交 0820ab51 编写于 作者: S Steven Whitehouse

[GFS2] Use slab operations for all gfs2_bufdata allocations

The old revoke structure was allocated using kalloc/kfree but
there is a slab cache for gfs2_bufdata, so we should use that
now that the structures have been converted.

This is part two of the patch series to merge the revoke
and gfs2_bufdata structures.
Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
上级 82e86087
......@@ -393,7 +393,7 @@ static void revoke_lo_before_commit(struct gfs2_sbd *sdp)
}
*(__be64 *)(bh->b_data + offset) = cpu_to_be64(bd->bd_blkno);
kfree(bd);
kmem_cache_free(gfs2_bufdata_cachep, bd);
offset += sizeof(u64);
}
......
......@@ -144,7 +144,7 @@ void gfs2_trans_add_bh(struct gfs2_glock *gl, struct buffer_head *bh, int meta)
void gfs2_trans_add_revoke(struct gfs2_sbd *sdp, u64 blkno)
{
struct gfs2_bufdata *bd = kmalloc(sizeof(struct gfs2_bufdata),
struct gfs2_bufdata *bd = kmem_cache_alloc(gfs2_bufdata_cachep,
GFP_NOFS | __GFP_NOFAIL);
lops_init_le(&bd->bd_le, &gfs2_revoke_lops);
bd->bd_blkno = blkno;
......@@ -172,7 +172,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++;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册