switch do_fsync() to fget_light()
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 20 Apr 2012 03:52:50 +0000 (23:52 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 30 May 2012 03:28:29 +0000 (23:28 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/sync.c

index 0e8db93..11e3d1c 100644 (file)
--- a/fs/sync.c
+++ b/fs/sync.c
@@ -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;
 }