kill spurious reference to vmtruncate

Lots of filesystems calls vmtruncate despite not implementing the old
->truncate method.  Switch them to use simple_setsize and add some
comments about the truncate code where it seems fitting.

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Nick Piggin <[email protected]>
Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
[email protected] 2010-05-27 01:05:34 +10:00 • committed by Al Viro
commit 15c6fd9786
10 changed files with 37 additions and 22 deletions

View file

@ -700,8 +700,14 @@ out:
return 0;
page_cache_release(page);
/*
* XXX(hch): the call below should probably be replaced with
* a call to the gfs2-specific truncate blocks helper to actually
* release disk blocks..
*/
if (pos + len > ip->i_inode.i_size)
vmtruncate(&ip->i_inode, ip->i_inode.i_size);
simple_setsize(&ip->i_inode, ip->i_inode.i_size);
out_endtrans:
gfs2_trans_end(sdp);
out_trans_fail:

View file

@ -1071,6 +1071,9 @@ int gfs2_permission(struct inode *inode, int mask)
return error;
}
/*
* XXX: should be changed to have proper ordering by opencoding simple_setsize
*/
static int setattr_size(struct inode *inode, struct iattr *attr)
{
struct gfs2_inode *ip = GFS2_I(inode);
@ -1081,7 +1084,7 @@ static int setattr_size(struct inode *inode, struct iattr *attr)
error = gfs2_trans_begin(sdp, 0, sdp->sd_jdesc->jd_blocks);
if (error)
return error;
error = vmtruncate(inode, attr->ia_size);
error = simple_setsize(inode, attr->ia_size);
gfs2_trans_end(sdp);
if (error)
return error;