From 26b0d2e1a1606da10c4dc4e109d7b9f2d92aab6a Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 29 May 2014 09:41:29 +0530 Subject: Avoid stat/fstat in statvfs/fstatvfs (BZ #15132) Delay the use of stat/fstat until stat data is required. When the kernel returns ST_VALID, stat data is not used by __internal_statvfs. --- sysdeps/unix/sysv/linux/statvfs64.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'sysdeps/unix/sysv/linux/statvfs64.c') diff --git a/sysdeps/unix/sysv/linux/statvfs64.c b/sysdeps/unix/sysv/linux/statvfs64.c index e33e923..0ec8524 100644 --- a/sysdeps/unix/sysv/linux/statvfs64.c +++ b/sysdeps/unix/sysv/linux/statvfs64.c @@ -26,7 +26,7 @@ extern void __internal_statvfs64 (const char *name, struct statvfs64 *buf, - struct statfs64 *fsbuf, struct stat64 *st); + struct statfs64 *fsbuf, int fd); /* Return information about the filesystem on which FILE resides. */ @@ -61,12 +61,8 @@ __statvfs64 (const char *file, struct statvfs64 *buf) #endif if (res == 0) - { - /* Convert the result. */ - struct stat64 st; - __internal_statvfs64 (file, buf, &fsbuf, - stat64 (file, &st) == -1 ? NULL : &st); - } + /* Convert the result. */ + __internal_statvfs64 (file, buf, &fsbuf, -1); return res; } -- cgit v1.1