Skip to content

Commit

Permalink
switch do_fsync() to fget_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 442a9ff commit c2bd6c1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fs/sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,12 @@ static int do_fsync(unsigned int fd, int datasync)
{
struct file *file;
int ret = -EBADF;
int fput_needed;

file = fget(fd);
file = fget_light(fd, &fput_needed);
if (file) {
ret = vfs_fsync(file, datasync);
fput(file);
fput_light(file, fput_needed);
}
return ret;
}
Expand Down

0 comments on commit c2bd6c1

Please sign in to comment.