compat: fs: Generic compat_sys_sendfile implementation
[firefly-linux-kernel-4.4.55.git] / fs / stat.c
index 40780229a03281376d4d449e896745f3f169a0d3..ee18fa122ae06a416e6f416660616169fee9deae 100644 (file)
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -57,13 +57,13 @@ EXPORT_SYMBOL(vfs_getattr);
 
 int vfs_fstat(unsigned int fd, struct kstat *stat)
 {
-       int fput_needed;
-       struct file *f = fget_raw_light(fd, &fput_needed);
+       struct fd f = fdget_raw(fd);
        int error = -EBADF;
 
-       if (f) {
-               error = vfs_getattr(f->f_path.mnt, f->f_path.dentry, stat);
-               fput_light(f, fput_needed);
+       if (f.file) {
+               error = vfs_getattr(f.file->f_path.mnt, f.file->f_path.dentry,
+                                   stat);
+               fdput(f);
        }
        return error;
 }