diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-04-28 14:55:17 -0700 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2012-09-19 15:05:25 +0100 |
commit | 7c6430b9b762972e99ff841a4c78d6cc02be8e51 (patch) | |
tree | 106dbaa71dd14e03c810cfec7c3f11cbfba39ea9 | |
parent | 62ae7bbdbb77a210eb839f34dc0d1923a4842dbd (diff) | |
download | lwn-7c6430b9b762972e99ff841a4c78d6cc02be8e51.tar.gz lwn-7c6430b9b762972e99ff841a4c78d6cc02be8e51.zip |
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>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-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; } |