aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/bmap.c
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@redhat.com>2011-06-23 11:39:34 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2011-07-15 04:32:52 -0400
commit46fcb2ed29ff7a9ec34c4ae67b631743eb7e756f (patch)
treef28487201dd8fe815192b75d1b29426a7882a01b /fs/gfs2/bmap.c
parent9964afbb797329e4c6e5d05ebc199c39af618c5f (diff)
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 e65493a8ac00..42e477f31223 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,
854 blen++; 854 blen++;
855 else { 855 else {
856 if (bstart) { 856 if (bstart) {
857 if (metadata) 857 __gfs2_free_blocks(ip, bstart, blen, metadata);
858 __gfs2_free_meta(ip, bstart, blen);
859 else
860 __gfs2_free_data(ip, bstart, blen);
861
862 btotal += blen; 858 btotal += blen;
863 } 859 }
864 860
@@ -870,11 +866,7 @@ static int do_strip(struct gfs2_inode *ip, struct buffer_head *dibh,
870 gfs2_add_inode_blocks(&ip->i_inode, -1); 866 gfs2_add_inode_blocks(&ip->i_inode, -1);
871 } 867 }
872 if (bstart) { 868 if (bstart) {
873 if (metadata) 869 __gfs2_free_blocks(ip, bstart, blen, metadata);
874 __gfs2_free_meta(ip, bstart, blen);
875 else
876 __gfs2_free_data(ip, bstart, blen);
877
878 btotal += blen; 870 btotal += blen;
879 } 871 }
880 872