提交 e994defb 编写于 作者: L Linus Torvalds

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: NLinus Torvalds <torvalds@linux-foundation.org>
上级 3f9f0aa6
...@@ -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(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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册