about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/fstatvfs64.c
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2014-05-29 09:41:29 +0530
committerSiddhesh Poyarekar <siddhesh@redhat.com>2014-05-29 09:41:29 +0530
commit26b0d2e1a1606da10c4dc4e109d7b9f2d92aab6a (patch)
tree80f00460ffda84fa25dae201b40c5442646cf213 /sysdeps/unix/sysv/linux/fstatvfs64.c
parent0d3b7a190c3abbdce27d4b0b9f16517bf5664099 (diff)
downloadglibc-26b0d2e1a1606da10c4dc4e109d7b9f2d92aab6a.tar.gz
glibc-26b0d2e1a1606da10c4dc4e109d7b9f2d92aab6a.tar.xz
glibc-26b0d2e1a1606da10c4dc4e109d7b9f2d92aab6a.zip
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.
Diffstat (limited to 'sysdeps/unix/sysv/linux/fstatvfs64.c')
-rw-r--r--sysdeps/unix/sysv/linux/fstatvfs64.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/sysdeps/unix/sysv/linux/fstatvfs64.c b/sysdeps/unix/sysv/linux/fstatvfs64.c
index dd10c1ffec..006b0591ba 100644
--- a/sysdeps/unix/sysv/linux/fstatvfs64.c
+++ b/sysdeps/unix/sysv/linux/fstatvfs64.c
@@ -25,7 +25,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 FD resides.  */
@@ -60,12 +60,8 @@ __fstatvfs64 (int fd, struct statvfs64 *buf)
 #endif
 
   if (res == 0)
-    {
-      /* Convert the result.  */
-      struct stat64 st;
-      __internal_statvfs64 (NULL, buf, &fsbuf,
-			    fstat64 (fd, &st) == -1 ? NULL : &st);
-    }
+    /* Convert the result.  */
+    __internal_statvfs64 (NULL, buf, &fsbuf, fd);
 
   return res;
 }