diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-04-28 14:55:17 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-06-07 16:02:04 -0700 |
commit | 9b67aeff9256ad337e22b0f3b228b7ec01ff2a20 (patch) | |
tree | 3c22c75218d6f61bd4107262aebf44cdc7435abb /fs | |
parent | 4652951d1202cef2798b1a0dfbf4122794594b41 (diff) |
VFS: make vfs_fstat() use f[get|put]_light()
commit e994defb7b6813ba6fa7a2a36e86d2455ad1dc35 upstream.
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>
[xr: Backported to 3.4: adjust function name]
Signed-off-by: Rui Xiang <rui.xiang@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-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 dc6d0be300ca..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_raw(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; } |