switch flock to fget_light/fput_light
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -1636,12 +1636,13 @@ EXPORT_SYMBOL(flock_lock_file_wait);
|
|||||||
SYSCALL_DEFINE2(flock, unsigned int, fd, unsigned int, cmd)
|
SYSCALL_DEFINE2(flock, unsigned int, fd, unsigned int, cmd)
|
||||||
{
|
{
|
||||||
struct file *filp;
|
struct file *filp;
|
||||||
|
int fput_needed;
|
||||||
struct file_lock *lock;
|
struct file_lock *lock;
|
||||||
int can_sleep, unlock;
|
int can_sleep, unlock;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
error = -EBADF;
|
error = -EBADF;
|
||||||
filp = fget(fd);
|
filp = fget_light(fd, &fput_needed);
|
||||||
if (!filp)
|
if (!filp)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
@@ -1674,7 +1675,7 @@ SYSCALL_DEFINE2(flock, unsigned int, fd, unsigned int, cmd)
|
|||||||
locks_free_lock(lock);
|
locks_free_lock(lock);
|
||||||
|
|
||||||
out_putf:
|
out_putf:
|
||||||
fput(filp);
|
fput_light(filp, fput_needed);
|
||||||
out:
|
out:
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user