aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2007-09-02 11:47:38 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2007-10-10 03:56:10 -0400
commit0820ab517e1b100ee3f9584ec27f93309689ebe7 (patch)
treedb2baf9e6d2ac545c344a412fe31371a09bf9b68 /fs
parent82e86087bb774cd54d47db4a7c771b5b29bea9ed (diff)
[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: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/gfs2/lops.c2
-rw-r--r--fs/gfs2/trans.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c
index cf6fe3631554..4cbef4c23a6b 100644
--- a/fs/gfs2/lops.c
+++ b/fs/gfs2/lops.c
@@ -393,7 +393,7 @@ static void revoke_lo_before_commit(struct gfs2_sbd *sdp)
393 } 393 }
394 394
395 *(__be64 *)(bh->b_data + offset) = cpu_to_be64(bd->bd_blkno); 395 *(__be64 *)(bh->b_data + offset) = cpu_to_be64(bd->bd_blkno);
396 kfree(bd); 396 kmem_cache_free(gfs2_bufdata_cachep, bd);
397 397
398 offset += sizeof(u64); 398 offset += sizeof(u64);
399 } 399 }
diff --git a/fs/gfs2/trans.c b/fs/gfs2/trans.c
index eadf96e00510..01cc27fefd84 100644
--- a/fs/gfs2/trans.c
+++ b/fs/gfs2/trans.c
@@ -144,7 +144,7 @@ void gfs2_trans_add_bh(struct gfs2_glock *gl, struct buffer_head *bh, int meta)
144 144
145void gfs2_trans_add_revoke(struct gfs2_sbd *sdp, u64 blkno) 145void gfs2_trans_add_revoke(struct gfs2_sbd *sdp, u64 blkno)
146{ 146{
147 struct gfs2_bufdata *bd = kmalloc(sizeof(struct gfs2_bufdata), 147 struct gfs2_bufdata *bd = kmem_cache_alloc(gfs2_bufdata_cachep,
148 GFP_NOFS | __GFP_NOFAIL); 148 GFP_NOFS | __GFP_NOFAIL);
149 lops_init_le(&bd->bd_le, &gfs2_revoke_lops); 149 lops_init_le(&bd->bd_le, &gfs2_revoke_lops);
150 bd->bd_blkno = blkno; 150 bd->bd_blkno = blkno;
@@ -172,7 +172,7 @@ void gfs2_trans_add_unrevoke(struct gfs2_sbd *sdp, u64 blkno)
172 172
173 if (found) { 173 if (found) {
174 struct gfs2_trans *tr = current->journal_info; 174 struct gfs2_trans *tr = current->journal_info;
175 kfree(bd); 175 kmem_cache_free(gfs2_bufdata_cachep, bd);
176 tr->tr_num_revoke_rm++; 176 tr->tr_num_revoke_rm++;
177 } 177 }
178} 178}