mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
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.
This commit is contained in:
committed by
Siddhesh Poyarekar
parent
0d3b7a190c
commit
26b0d2e1a1
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user