Skip to content

Commit

Permalink
switch flock to fget_light/fput_light
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed May 30, 2012
1 parent 20ba5d7 commit bdc6895
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fs/locks.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit bdc6895

Please sign in to comment.