summaryrefslogtreecommitdiffstats
path: root/fs/gfs2/bmap.c
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@redhat.com>2011-06-23 10:39:34 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2011-07-15 09:32:52 +0100
commit46fcb2ed29ff7a9ec34c4ae67b631743eb7e756f (patch)
treef28487201dd8fe815192b75d1b29426a7882a01b /fs/gfs2/bmap.c
parent9964afbb797329e4c6e5d05ebc199c39af618c5f (diff)
downloadop-kernel-dev-46fcb2ed29ff7a9ec34c4ae67b631743eb7e756f.zip
op-kernel-dev-46fcb2ed29ff7a9ec34c4ae67b631743eb7e756f.tar.gz
GFS2: combine duplicated block freeing routines
__gfs2_free_data and __gfs2_free_meta are almost identical, and can be trivially combined. [This is as per Eric's original patch minus gfs2_free_data() which had no callers left and plus the conversion of the bmap.c calls to these functions. All in all, a nice clean up] Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/bmap.c')
-rw-r--r--fs/gfs2/bmap.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c
index e65493a..42e477f 100644
--- a/fs/gfs2/bmap.c
+++ b/fs/gfs2/bmap.c
@@ -854,11 +854,7 @@ static int do_strip(struct gfs2_inode *ip, struct buffer_head *dibh,
blen++;
else {
if (bstart) {
- if (metadata)
- __gfs2_free_meta(ip, bstart, blen);
- else
- __gfs2_free_data(ip, bstart, blen);
-
+ __gfs2_free_blocks(ip, bstart, blen, metadata);
btotal += blen;
}
@@ -870,11 +866,7 @@ static int do_strip(struct gfs2_inode *ip, struct buffer_head *dibh,
gfs2_add_inode_blocks(&ip->i_inode, -1);
}
if (bstart) {
- if (metadata)
- __gfs2_free_meta(ip, bstart, blen);
- else
- __gfs2_free_data(ip, bstart, blen);
-
+ __gfs2_free_blocks(ip, bstart, blen, metadata);
btotal += blen;
}
OpenPOWER on IntegriCloud