and write it out to disk */
 
                if (isdir) {
-                       block = gfs2_alloc_meta(ip);
+                       block = gfs2_alloc_block(ip);
                        gfs2_trans_add_unrevoke(GFS2_SB(&ip->i_inode), block, 1);
                        error = gfs2_dir_get_new_buffer(ip, block, &bh);
                        if (error)
                                              dibh, sizeof(struct gfs2_dinode));
                        brelse(bh);
                } else {
-                       block = gfs2_alloc_data(ip);
+                       block = gfs2_alloc_block(ip);
 
                        error = gfs2_unstuffer_page(ip, dibh, block, page);
                        if (error)
                return error;
 
        for(n = 0; n < new_height; n++) {
-               bn = gfs2_alloc_meta(ip);
+               bn = gfs2_alloc_block(ip);
                gfs2_trans_add_unrevoke(GFS2_SB(inode), bn, 1);
                mp->mp_bh[n] = gfs2_meta_new(ip->i_gl, bn);
                gfs2_trans_add_bh(ip->i_gl, mp->mp_bh[n], 1);
        if (!create)
                return 0;
 
-       if (height == ip->i_height - 1 && !gfs2_is_dir(ip))
-               *block = gfs2_alloc_data(ip);
-       else {
-               *block = gfs2_alloc_meta(ip);
+       *block = gfs2_alloc_block(ip);
+       if (height != ip->i_height - 1 || gfs2_is_dir(ip))
                gfs2_trans_add_unrevoke(GFS2_SB(&ip->i_inode), *block, 1);
-       }
 
        gfs2_trans_add_bh(ip->i_gl, mp->mp_bh[height], 1);
 
 
 static struct gfs2_leaf *new_leaf(struct inode *inode, struct buffer_head **pbh, u16 depth)
 {
        struct gfs2_inode *ip = GFS2_I(inode);
-       u64 bn = gfs2_alloc_meta(ip);
+       u64 bn = gfs2_alloc_block(ip);
        struct buffer_head *bh = gfs2_meta_new(ip->i_gl, bn);
        struct gfs2_leaf *leaf;
        struct gfs2_dirent *dent;
 
        struct gfs2_ea_header *ea;
        u64 block;
 
-       block = gfs2_alloc_meta(ip);
+       block = gfs2_alloc_block(ip);
        gfs2_trans_add_unrevoke(sdp, block, 1);
        *bhp = gfs2_meta_new(ip->i_gl, block);
        gfs2_trans_add_bh(ip->i_gl, *bhp, 1);
                        u64 block;
                        int mh_size = sizeof(struct gfs2_meta_header);
 
-                       block = gfs2_alloc_meta(ip);
+                       block = gfs2_alloc_block(ip);
                        gfs2_trans_add_unrevoke(sdp, block, 1);
                        bh = gfs2_meta_new(ip->i_gl, block);
                        gfs2_trans_add_bh(ip->i_gl, bh, 1);
        } else {
                u64 blk;
 
-               blk = gfs2_alloc_meta(ip);
+               blk = gfs2_alloc_block(ip);
                gfs2_trans_add_unrevoke(sdp, blk, 1);
                indbh = gfs2_meta_new(ip->i_gl, blk);
                gfs2_trans_add_bh(ip->i_gl, indbh, 1);
 
 }
 
 /**
- * gfs2_alloc_data - Allocate a data block
- * @ip: the inode to allocate the data block for
+ * gfs2_alloc_block - Allocate a block
+ * @ip: the inode to allocate the block for
  *
  * Returns: the allocated block
  */
 
-u64 gfs2_alloc_data(struct gfs2_inode *ip)
-{
-       struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
-       struct gfs2_alloc *al = ip->i_alloc;
-       struct gfs2_rgrpd *rgd = al->al_rgd;
-       u32 goal, blk;
-       u64 block;
-
-       if (rgrp_contains_block(rgd, ip->i_goal))
-               goal = ip->i_goal - rgd->rd_data0;
-       else
-               goal = rgd->rd_last_alloc;
-
-       blk = rgblk_search(rgd, goal, GFS2_BLKST_FREE, GFS2_BLKST_USED);
-       BUG_ON(blk == BFITNOENT);
-       rgd->rd_last_alloc = blk;
-
-       block = rgd->rd_data0 + blk;
-       ip->i_goal = block;
-
-       gfs2_assert_withdraw(sdp, rgd->rd_rg.rg_free);
-       rgd->rd_rg.rg_free--;
-
-       gfs2_trans_add_bh(rgd->rd_gl, rgd->rd_bits[0].bi_bh, 1);
-       gfs2_rgrp_out(rgd, rgd->rd_bits[0].bi_bh->b_data);
-
-       al->al_alloced++;
-
-       gfs2_statfs_change(sdp, 0, -1, 0);
-       gfs2_quota_change(ip, +1, ip->i_inode.i_uid, ip->i_inode.i_gid);
-
-       spin_lock(&sdp->sd_rindex_spin);
-       rgd->rd_free_clone--;
-       spin_unlock(&sdp->sd_rindex_spin);
-
-       return block;
-}
-
-/**
- * gfs2_alloc_meta - Allocate a metadata block
- * @ip: the inode to allocate the metadata block for
- *
- * Returns: the allocated block
- */
-
-u64 gfs2_alloc_meta(struct gfs2_inode *ip)
+u64 gfs2_alloc_block(struct gfs2_inode *ip)
 {
        struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
        struct gfs2_alloc *al = ip->i_alloc;
 
 
 unsigned char gfs2_get_block_type(struct gfs2_rgrpd *rgd, u64 block);
 
-u64 gfs2_alloc_data(struct gfs2_inode *ip);
-u64 gfs2_alloc_meta(struct gfs2_inode *ip);
+u64 gfs2_alloc_block(struct gfs2_inode *ip);
 u64 gfs2_alloc_di(struct gfs2_inode *ip, u64 *generation);
 
 void gfs2_free_data(struct gfs2_inode *ip, u64 bstart, u32 blen);