diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2010-08-11 04:37:53 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2010-09-20 06:18:16 -0400 |
commit | ff8f33c8b30d7b7efdcf2548c7f6e64db6a89b29 (patch) | |
tree | a21bad4d2b48f743dd96277b1c966c35aefe1ce2 /fs/gfs2/aops.c | |
parent | 2422084a94fcd5038406261b331672a13c92c050 (diff) |
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.c | 10 |
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: | |||
696 | 696 | ||
697 | page_cache_release(page); | 697 | page_cache_release(page); |
698 | 698 | ||
699 | /* | 699 | gfs2_trans_end(sdp); |
700 | * XXX(truncate): the call below should probably be replaced with | ||
701 | * a call to the gfs2-specific truncate blocks helper to actually | ||
702 | * release disk blocks.. | ||
703 | */ | ||
704 | if (pos + len > ip->i_inode.i_size) | 700 | if (pos + len > ip->i_inode.i_size) |
705 | truncate_setsize(&ip->i_inode, ip->i_inode.i_size); | 701 | gfs2_trim_blocks(&ip->i_inode); |
702 | goto out_trans_fail; | ||
703 | |||
706 | out_endtrans: | 704 | out_endtrans: |
707 | gfs2_trans_end(sdp); | 705 | gfs2_trans_end(sdp); |
708 | out_trans_fail: | 706 | out_trans_fail: |