Commit 9b67aeff authored by Linus Torvalds's avatar Linus Torvalds Committed by Greg Kroah-Hartman

VFS: make vfs_fstat() use f[get|put]_light()

commit e994defb upstream.

Use the *_light() versions that properly avoid doing the file user count
updates when they are unnecessary.
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
[xr: Backported to 3.4: adjust function name]
Signed-off-by: default avatarRui Xiang <rui.xiang@huawei.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4652951d
...@@ -57,12 +57,13 @@ EXPORT_SYMBOL(vfs_getattr); ...@@ -57,12 +57,13 @@ EXPORT_SYMBOL(vfs_getattr);
int vfs_fstat(unsigned int fd, struct kstat *stat) 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; int error = -EBADF;
if (f) { if (f) {
error = vfs_getattr(f->f_path.mnt, f->f_path.dentry, stat); error = vfs_getattr(f->f_path.mnt, f->f_path.dentry, stat);
fput(f); fput_light(f, fput_needed);
} }
return error; return error;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment