switch flock to fget_light/fput_light

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Al Viro 2012-04-21 18:46:53 -04:00
parent 20ba5d736f
commit bdc689594b

View file

@ -1636,12 +1636,13 @@ EXPORT_SYMBOL(flock_lock_file_wait);
SYSCALL_DEFINE2(flock, unsigned int, fd, unsigned int, cmd)
{
struct file *filp;
int fput_needed;
struct file_lock *lock;
int can_sleep, unlock;
int error;
error = -EBADF;
filp = fget(fd);
filp = fget_light(fd, &fput_needed);
if (!filp)
goto out;
@ -1674,7 +1675,7 @@ SYSCALL_DEFINE2(flock, unsigned int, fd, unsigned int, cmd)
locks_free_lock(lock);
out_putf:
fput(filp);
fput_light(filp, fput_needed);
out:
return error;
}