summaryrefslogtreecommitdiffstats
path: root/fs/open.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-08-26 20:22:10 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-09-26 21:10:03 -0400
commitd6483b7a78438bc333560d11b69e6a6a6cf55940 (patch)
tree86111580d45c0d1cad04809c7f619b4d04107d1a /fs/open.c
parent6b48c5b2079af1f81d8f249ae07a988d8c45b32f (diff)
downloadop-kernel-dev-d6483b7a78438bc333560d11b69e6a6a6cf55940.zip
op-kernel-dev-d6483b7a78438bc333560d11b69e6a6a6cf55940.tar.gz
switch fchmod(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.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/fs/open.c b/fs/open.c
index da6d3f1..3c741ea 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -582,23 +582,21 @@ SYSCALL_DEFINE3(lchown, const char __user *, filename, uid_t, user, gid_t, group
SYSCALL_DEFINE3(fchown, unsigned int, fd, uid_t, user, gid_t, group)
{
- struct file * file;
- int error = -EBADF;
- struct dentry * dentry;
+ struct file *file;
+ int error = -EBADF, fput_needed;
- file = fget(fd);
+ file = fget_light(fd, &fput_needed);
if (!file)
goto out;
error = mnt_want_write_file(file);
if (error)
goto out_fput;
- dentry = file->f_path.dentry;
- audit_inode(NULL, dentry);
+ audit_inode(NULL, file->f_path.dentry);
error = chown_common(&file->f_path, user, group);
mnt_drop_write_file(file);
out_fput:
- fput(file);
+ fput_light(file, fput_needed);
out:
return error;
}
OpenPOWER on IntegriCloud