mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
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:
parent
7bb46a6734
commit
15c6fd9786
10 changed files with 37 additions and 22 deletions
|
|
@ -501,12 +501,10 @@ out:
|
|||
return err;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* We don't define our `inode->i_op->truncate', and call it here,
|
||||
* because of:
|
||||
* - there is no way to know old size
|
||||
* - there is no way inform user about error, if it happens in `truncate'
|
||||
* TODO:
|
||||
* - truncate case should use proper ordering instead of using
|
||||
* simple_setsize
|
||||
*/
|
||||
int ufs_setattr(struct dentry *dentry, struct iattr *attr)
|
||||
{
|
||||
|
|
@ -530,7 +528,7 @@ int ufs_setattr(struct dentry *dentry, struct iattr *attr)
|
|||
if (ia_valid & ATTR_SIZE && attr->ia_size != inode->i_size) {
|
||||
loff_t old_i_size = inode->i_size;
|
||||
|
||||
error = vmtruncate(inode, attr->ia_size);
|
||||
error = simple_setsize(inode, attr->ia_size);
|
||||
if (error)
|
||||
return error;
|
||||
error = ufs_truncate(inode, old_i_size);
|
||||
|
|
|
|||
Loading…
Reference in a new issue