summaryrefslogtreecommitdiffstats
path: root/fs/open.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-08-27 02:13:36 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2012-09-27 03:10:02 +0200
commitbf2965d5b5950d09e934ea5d961d79d0ed1fae7e (patch)
treeabff32286098495fe01355186bde557a70c2e088 /fs/open.c
parentnamei.c: fix BS comment (diff)
downloadlinux-bf2965d5b5950d09e934ea5d961d79d0ed1fae7e.tar.xz
linux-bf2965d5b5950d09e934ea5d961d79d0ed1fae7e.zip
switch ftruncate(2) to fget_light
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/open.c')
-rw-r--r--fs/open.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/open.c b/fs/open.c
index 03028d0e7487..9f61d7269d39 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -132,16 +132,16 @@ SYSCALL_DEFINE2(truncate, const char __user *, path, long, length)
static long do_sys_ftruncate(unsigned int fd, loff_t length, int small)
{
- struct inode * inode;
+ struct inode *inode;
struct dentry *dentry;
- struct file * file;
- int error;
+ struct file *file;
+ int error, fput_needed;
error = -EINVAL;
if (length < 0)
goto out;
error = -EBADF;
- file = fget(fd);
+ file = fget_light(fd, &fput_needed);
if (!file)
goto out;
@@ -172,7 +172,7 @@ static long do_sys_ftruncate(unsigned int fd, loff_t length, int small)
error = do_truncate(dentry, length, ATTR_MTIME|ATTR_CTIME, file);
sb_end_write(inode->i_sb);
out_putf:
- fput(file);
+ fput_light(file, fput_needed);
out:
return error;
}