aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ufs/truncate.c
diff options
context:
space:
mode:
authornpiggin@suse.de <npiggin@suse.de>2010-05-26 11:05:34 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2010-05-27 22:15:42 -0400
commit15c6fd9786dfaab43547bf60df6fa63170fb64fc (patch)
treeafd997b3402761e28b6c39f414fbd93c69fdcdce /fs/ufs/truncate.c
parent7bb46a6734a7e1ad4beaecc11cae7ed3ff81d30f (diff)
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 <hch@lst.de> Signed-off-by: Nick Piggin <npiggin@suse.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ufs/truncate.c')
-rw-r--r--fs/ufs/truncate.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/ufs/truncate.c b/fs/ufs/truncate.c
index f294c44577dc..3733057e7833 100644
--- a/fs/ufs/truncate.c
+++ b/fs/ufs/truncate.c
@@ -501,12 +501,10 @@ out:
501 return err; 501 return err;
502} 502}
503 503
504
505/* 504/*
506 * We don't define our `inode->i_op->truncate', and call it here, 505 * TODO:
507 * because of: 506 * - truncate case should use proper ordering instead of using
508 * - there is no way to know old size 507 * simple_setsize
509 * - there is no way inform user about error, if it happens in `truncate'
510 */ 508 */
511int ufs_setattr(struct dentry *dentry, struct iattr *attr) 509int ufs_setattr(struct dentry *dentry, struct iattr *attr)
512{ 510{
@@ -530,7 +528,7 @@ int ufs_setattr(struct dentry *dentry, struct iattr *attr)
530 if (ia_valid & ATTR_SIZE && attr->ia_size != inode->i_size) { 528 if (ia_valid & ATTR_SIZE && attr->ia_size != inode->i_size) {
531 loff_t old_i_size = inode->i_size; 529 loff_t old_i_size = inode->i_size;
532 530
533 error = vmtruncate(inode, attr->ia_size); 531 error = simple_setsize(inode, attr->ia_size);
534 if (error) 532 if (error)
535 return error; 533 return error;
536 error = ufs_truncate(inode, old_i_size); 534 error = ufs_truncate(inode, old_i_size);