logfs: drop vmtruncate
authorMarco Stornelli <marco.stornelli@gmail.com>
Sat, 15 Dec 2012 10:55:42 +0000 (11:55 +0100)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 20 Dec 2012 23:40:53 +0000 (18:40 -0500)
Removed vmtruncate

Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/logfs/readwrite.c

index e1a3b6bf63244237215824021d87f553bf4482a6..9a59cbade2fb5254b2602ba8baf212676d62bca3 100644 (file)
@@ -1887,9 +1887,15 @@ int logfs_truncate(struct inode *inode, u64 target)
                logfs_put_wblocks(sb, NULL, 1);
        }
 
-       if (!err)
-               err = vmtruncate(inode, target);
+       if (!err) {
+               err = inode_newsize_ok(inode, target);
+               if (err)
+                       goto out;
+
+               truncate_setsize(inode, target);
+       }
 
+ out:
        /* I don't trust error recovery yet. */
        WARN_ON(err);
        return err;