switch fadvise(2) to fget_light()
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 27 Aug 2012 00:27:09 +0000 (20:27 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 27 Sep 2012 01:10:04 +0000 (21:10 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
mm/fadvise.c

index 9b75a045dbf4bf63e250372daad3f878909ecfdd..a83245763cf8fdd856203e2f713840d77ef1d7d1 100644 (file)
@@ -26,7 +26,8 @@
  */
 SYSCALL_DEFINE(fadvise64_64)(int fd, loff_t offset, loff_t len, int advice)
 {
-       struct file *file = fget(fd);
+       int fput_needed;
+       struct file *file = fget_light(fd, &fput_needed);
        struct address_space *mapping;
        struct backing_dev_info *bdi;
        loff_t endbyte;                 /* inclusive */
@@ -128,7 +129,7 @@ SYSCALL_DEFINE(fadvise64_64)(int fd, loff_t offset, loff_t len, int advice)
                ret = -EINVAL;
        }
 out:
-       fput(file);
+       fput_light(file, fput_needed);
        return ret;
 }
 #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS