From: Linus Torvalds Date: Sat, 28 Apr 2012 21:55:17 +0000 (-0700) Subject: VFS: make vfs_fstat() use f[get|put]_light() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e994defb7b6813ba6fa7a2a36e86d2455ad1dc35;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git VFS: make vfs_fstat() use f[get|put]_light() Use the *_light() versions that properly avoid doing the file user count updates when they are unnecessary. Signed-off-by: Linus Torvalds --- diff --git a/fs/stat.c b/fs/stat.c index c733dc5753ae..88b36c770762 100644 --- a/fs/stat.c +++ b/fs/stat.c @@ -57,12 +57,13 @@ EXPORT_SYMBOL(vfs_getattr); int vfs_fstat(unsigned int fd, struct kstat *stat) { - struct file *f = fget(fd); + int fput_needed; + struct file *f = fget_light(fd, &fput_needed); int error = -EBADF; if (f) { error = vfs_getattr(f->f_path.mnt, f->f_path.dentry, stat); - fput(f); + fput_light(f, fput_needed); } return error; }