aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/bmap.c
diff options
context:
space:
mode:
authorSteven Whitehouse <steve@men-an-tol.chygwyn.com>2006-01-24 05:37:06 -0500
committerSteven Whitehouse <steve@men-an-tol.chygwyn.com>2006-01-24 05:37:06 -0500
commitaa6a85a971065b013a71a399c3fc4312e2dd81eb (patch)
treeae2d11d0ec557f17cce29e79b18df29b78f9b0f7 /fs/gfs2/bmap.c
parent8ca05c60de49c3bb523a435abc216b6b6eeb1067 (diff)
[GFS2] Remove pointless argument relating to truncate
For some reason a function pointer was being passed through the truncate code which only ever took one value. This removes the function pointer and replaces it with a single call to the function in question. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/bmap.c')
-rw-r--r--fs/gfs2/bmap.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c
index 967cbc68195a..ff4a9175b4e1 100644
--- a/fs/gfs2/bmap.c
+++ b/fs/gfs2/bmap.c
@@ -841,8 +841,7 @@ static int truncator_journaled(struct gfs2_inode *ip, uint64_t size)
841 return 0; 841 return 0;
842} 842}
843 843
844static int trunc_start(struct gfs2_inode *ip, uint64_t size, 844static int trunc_start(struct gfs2_inode *ip, uint64_t size)
845 gfs2_truncator_t truncator)
846{ 845{
847 struct gfs2_sbd *sdp = ip->i_sbd; 846 struct gfs2_sbd *sdp = ip->i_sbd;
848 struct buffer_head *dibh; 847 struct buffer_head *dibh;
@@ -873,7 +872,7 @@ static int trunc_start(struct gfs2_inode *ip, uint64_t size,
873 if (do_div(junk, sdp->sd_jbsize)) 872 if (do_div(junk, sdp->sd_jbsize))
874 error = truncator_journaled(ip, size); 873 error = truncator_journaled(ip, size);
875 } else if (size & (uint64_t)(sdp->sd_sb.sb_bsize - 1)) 874 } else if (size & (uint64_t)(sdp->sd_sb.sb_bsize - 1))
876 error = truncator(ip, size); 875 error = gfs2_truncator_page(ip, size);
877 876
878 if (!error) { 877 if (!error) {
879 ip->i_di.di_size = size; 878 ip->i_di.di_size = size;
@@ -980,12 +979,11 @@ static int trunc_end(struct gfs2_inode *ip)
980 * Returns: errno 979 * Returns: errno
981 */ 980 */
982 981
983static int do_shrink(struct gfs2_inode *ip, uint64_t size, 982static int do_shrink(struct gfs2_inode *ip, uint64_t size)
984 gfs2_truncator_t truncator)
985{ 983{
986 int error; 984 int error;
987 985
988 error = trunc_start(ip, size, truncator); 986 error = trunc_start(ip, size);
989 if (error < 0) 987 if (error < 0)
990 return error; 988 return error;
991 if (error > 0) 989 if (error > 0)
@@ -1009,8 +1007,7 @@ static int do_shrink(struct gfs2_inode *ip, uint64_t size,
1009 * Returns: errno 1007 * Returns: errno
1010 */ 1008 */
1011 1009
1012int gfs2_truncatei(struct gfs2_inode *ip, uint64_t size, 1010int gfs2_truncatei(struct gfs2_inode *ip, uint64_t size)
1013 gfs2_truncator_t truncator)
1014{ 1011{
1015 int error; 1012 int error;
1016 1013
@@ -1020,7 +1017,7 @@ int gfs2_truncatei(struct gfs2_inode *ip, uint64_t size,
1020 if (size > ip->i_di.di_size) 1017 if (size > ip->i_di.di_size)
1021 error = do_grow(ip, size); 1018 error = do_grow(ip, size);
1022 else 1019 else
1023 error = do_shrink(ip, size, truncator); 1020 error = do_shrink(ip, size);
1024 1021
1025 return error; 1022 return error;
1026} 1023}