summaryrefslogtreecommitdiffstats
path: root/fs/gfs2/aops.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2010-08-11 10:37:53 +0200
committerSteven Whitehouse <swhiteho@redhat.com>2010-09-20 12:18:16 +0200
commitff8f33c8b30d7b7efdcf2548c7f6e64db6a89b29 (patch)
treea21bad4d2b48f743dd96277b1c966c35aefe1ce2 /fs/gfs2/aops.c
parentMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mat... (diff)
downloadlinux-ff8f33c8b30d7b7efdcf2548c7f6e64db6a89b29.tar.xz
linux-ff8f33c8b30d7b7efdcf2548c7f6e64db6a89b29.zip
GFS2: New truncate sequence
This updates GFS2's truncate code to use the new truncate sequence correctly. This is a stepping stone to being able to remove ip->i_disksize in favour of using i_size everywhere now that the two sizes are always identical. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com> Cc: Nick Piggin <npiggin@suse.de> Cc: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/gfs2/aops.c')
-rw-r--r--fs/gfs2/aops.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c
index 194fe16d8418..f687f25fb7ff 100644
--- a/fs/gfs2/aops.c
+++ b/fs/gfs2/aops.c
@@ -696,13 +696,11 @@ out:
page_cache_release(page);
- /*
- * XXX(truncate): the call below should probably be replaced with
- * a call to the gfs2-specific truncate blocks helper to actually
- * release disk blocks..
- */
+ gfs2_trans_end(sdp);
if (pos + len > ip->i_inode.i_size)
- truncate_setsize(&ip->i_inode, ip->i_inode.i_size);
+ gfs2_trim_blocks(&ip->i_inode);
+ goto out_trans_fail;
+
out_endtrans:
gfs2_trans_end(sdp);
out_trans_fail: