mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-15 21:30:43 +00:00
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>
This commit is contained in:
parent
3f9f0aa687
commit
e994defb7b
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user