diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2008-02-01 09:52:30 -0500 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2008-03-31 05:40:45 -0400 |
commit | 1639431a3f57b43da1e15e9268a1d691ac01ba26 (patch) | |
tree | 0e8147c9009c917566cf03c7e23f6ea4ffda8d72 /fs/gfs2/bmap.c | |
parent | 5731be53e3d82aedd06e02574f833a57b07a08d2 (diff) |
[GFS2] Merge gfs2_alloc_meta and gfs2_alloc_data
Thanks to the preceeding patches, the only difference between
these two functions is their name. We can thus merge them
and call the new function gfs2_alloc_block to reflect the
fact that it can allocate either kind of block.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/bmap.c')
-rw-r--r-- | fs/gfs2/bmap.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index 651e5320bb4f..e3a75a27cee7 100644 --- a/fs/gfs2/bmap.c +++ b/fs/gfs2/bmap.c | |||
@@ -137,7 +137,7 @@ int gfs2_unstuff_dinode(struct gfs2_inode *ip, struct page *page) | |||
137 | and write it out to disk */ | 137 | and write it out to disk */ |
138 | 138 | ||
139 | if (isdir) { | 139 | if (isdir) { |
140 | block = gfs2_alloc_meta(ip); | 140 | block = gfs2_alloc_block(ip); |
141 | gfs2_trans_add_unrevoke(GFS2_SB(&ip->i_inode), block, 1); | 141 | gfs2_trans_add_unrevoke(GFS2_SB(&ip->i_inode), block, 1); |
142 | error = gfs2_dir_get_new_buffer(ip, block, &bh); | 142 | error = gfs2_dir_get_new_buffer(ip, block, &bh); |
143 | if (error) | 143 | if (error) |
@@ -146,7 +146,7 @@ int gfs2_unstuff_dinode(struct gfs2_inode *ip, struct page *page) | |||
146 | dibh, sizeof(struct gfs2_dinode)); | 146 | dibh, sizeof(struct gfs2_dinode)); |
147 | brelse(bh); | 147 | brelse(bh); |
148 | } else { | 148 | } else { |
149 | block = gfs2_alloc_data(ip); | 149 | block = gfs2_alloc_block(ip); |
150 | 150 | ||
151 | error = gfs2_unstuffer_page(ip, dibh, block, page); | 151 | error = gfs2_unstuffer_page(ip, dibh, block, page); |
152 | if (error) | 152 | if (error) |
@@ -205,7 +205,7 @@ static int build_height(struct inode *inode, struct metapath *mp, unsigned heigh | |||
205 | return error; | 205 | return error; |
206 | 206 | ||
207 | for(n = 0; n < new_height; n++) { | 207 | for(n = 0; n < new_height; n++) { |
208 | bn = gfs2_alloc_meta(ip); | 208 | bn = gfs2_alloc_block(ip); |
209 | gfs2_trans_add_unrevoke(GFS2_SB(inode), bn, 1); | 209 | gfs2_trans_add_unrevoke(GFS2_SB(inode), bn, 1); |
210 | mp->mp_bh[n] = gfs2_meta_new(ip->i_gl, bn); | 210 | mp->mp_bh[n] = gfs2_meta_new(ip->i_gl, bn); |
211 | gfs2_trans_add_bh(ip->i_gl, mp->mp_bh[n], 1); | 211 | gfs2_trans_add_bh(ip->i_gl, mp->mp_bh[n], 1); |
@@ -369,12 +369,9 @@ static int lookup_block(struct gfs2_inode *ip, unsigned int height, | |||
369 | if (!create) | 369 | if (!create) |
370 | return 0; | 370 | return 0; |
371 | 371 | ||
372 | if (height == ip->i_height - 1 && !gfs2_is_dir(ip)) | 372 | *block = gfs2_alloc_block(ip); |
373 | *block = gfs2_alloc_data(ip); | 373 | if (height != ip->i_height - 1 || gfs2_is_dir(ip)) |
374 | else { | ||
375 | *block = gfs2_alloc_meta(ip); | ||
376 | gfs2_trans_add_unrevoke(GFS2_SB(&ip->i_inode), *block, 1); | 374 | gfs2_trans_add_unrevoke(GFS2_SB(&ip->i_inode), *block, 1); |
377 | } | ||
378 | 375 | ||
379 | gfs2_trans_add_bh(ip->i_gl, mp->mp_bh[height], 1); | 376 | gfs2_trans_add_bh(ip->i_gl, mp->mp_bh[height], 1); |
380 | 377 | ||