diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-04-28 14:55:17 -0700 |
---|---|---|
committer | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2017-12-21 02:07:19 +0100 |
commit | 091f708e28ebfc999395fa6d3137871d573ed623 (patch) | |
tree | 7a3dd949a816a3e31510d63acc70b35bf128413f | |
parent | b845598653cdda5c924175e88ffd10f902b5db51 (diff) |
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 <torvalds@linux-foundation.org>
(cherry picked from commit e994defb7b6813ba6fa7a2a36e86d2455ad1dc35)
Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com>
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
-rw-r--r-- | fs/stat.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/stat.c b/fs/stat.c index 8806b8997d2e..55ceb06f5cf4 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; } |