]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Remove __ASSUME_ST_INO_64_BIT.
authorJoseph Myers <joseph@codesourcery.com>
Tue, 18 Dec 2018 13:35:39 +0000 (13:35 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Tue, 18 Dec 2018 13:35:39 +0000 (13:35 +0000)
kernel-features.h has a macro __ASSUME_ST_INO_64_BIT, with a comment
"However, SH is lame, and still does not have a 64-bit inode field.".

The macro is, in fact, defined to 0 by Alpha as well as SH.  The Alpha
case is, however, trivially useless: none of the files that test
__ASSUME_ST_INO_64_BIT are built for Alpha (which gained kernel
support for stat64 syscalls, with a 64-bit st_ino field, in Linux
2.6.4; the define to 0 for Alpha in glibc predates that).

The SH kernel gained support for a 64-bit st_ino in struct stat64 in
commit 760bcb1deec13c50e20399c84cb6a8ea41cc2820 ("sh: Fix fstatat64()
syscall."), which is in Linux 2.6.22 and later.  So the redefinition
of __ASSUME_ST_INO_64_BIT to 0 is of no use for SH either; three of
the files testing it do so immediately after a stat64-family syscall
has been used, which will always have set the 64-bit st_ino correctly
(in addition to the 32-bit __st_ino), while the relevant code
__xstat32_conv executes only after such a syscall in the function
calling __xstat32_conv.

Thus this patch removes __ASSUME_ST_INO_64_BIT and code testing it.
Removing the useless [!__ASSUME_ST_INO_64_BIT] code in __xstat32_conv
renders the [_HAVE_STAT64___ST_INO] and [!_HAVE_STAT64___ST_INO] cases
around it identical, so that conditional is also removed.

Tested compilation with build-many-glibcs.py for its Alpha and SH
configurations; also ran the glibc testsuite for x86_64 and x86.

* sysdeps/unix/sysv/linux/kernel-features.h
(__ASSUME_ST_INO_64_BIT): Remove macro definition.
* sysdeps/unix/sysv/linux/alpha/kernel-features.h
(__ASSUME_ST_INO_64_BIT): Do not undefine and define.
* sysdeps/unix/sysv/linux/sh/kernel-features.h
(__ASSUME_ST_INO_64_BIT): Likewise.
* sysdeps/unix/sysv/linux/fxstat64.c: Do not include
<kernel-features.h>.
(___fxstat64) [_HAVE_STAT64___ST_INO && !__ASSUME_ST_INO_64_BIT]:
Remove conditional code.
* sysdeps/unix/sysv/linux/lxstat64.c: Do not include
<kernel-features.h>.
(___lxstat64) [_HAVE_STAT64___ST_INO && !__ASSUME_ST_INO_64_BIT]:
Remove conditional code.
* sysdeps/unix/sysv/linux/xstat64.c: Do not include
<kernel-features.h>.
(___xstat64) [_HAVE_STAT64___ST_INO && !__ASSUME_ST_INO_64_BIT]:
Remove conditional code.
* sysdeps/unix/sysv/linux/xstatconv.c: Do not include
<kernel-features.h>.
(__xstat32_conv) [_HAVE_STAT64___ST_INO]: Remove conditional code.
[!_HAVE_STAT64___ST_INO]: Make code unconditional.

ChangeLog
sysdeps/unix/sysv/linux/alpha/kernel-features.h
sysdeps/unix/sysv/linux/fxstat64.c
sysdeps/unix/sysv/linux/kernel-features.h
sysdeps/unix/sysv/linux/lxstat64.c
sysdeps/unix/sysv/linux/sh/kernel-features.h
sysdeps/unix/sysv/linux/xstat64.c
sysdeps/unix/sysv/linux/xstatconv.c

index f459021971c7e846d140d830183f53999329a0e7..a2765035dd5bf2cadcfefeb4ca983ceeaf15dbb1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,28 @@
+2018-12-18  Joseph Myers  <joseph@codesourcery.com>
+
+       * sysdeps/unix/sysv/linux/kernel-features.h
+       (__ASSUME_ST_INO_64_BIT): Remove macro definition.
+       * sysdeps/unix/sysv/linux/alpha/kernel-features.h
+       (__ASSUME_ST_INO_64_BIT): Do not undefine and define.
+       * sysdeps/unix/sysv/linux/sh/kernel-features.h
+       (__ASSUME_ST_INO_64_BIT): Likewise.
+       * sysdeps/unix/sysv/linux/fxstat64.c: Do not include
+       <kernel-features.h>.
+       (___fxstat64) [_HAVE_STAT64___ST_INO && !__ASSUME_ST_INO_64_BIT]:
+       Remove conditional code.
+       * sysdeps/unix/sysv/linux/lxstat64.c: Do not include
+       <kernel-features.h>.
+       (___lxstat64) [_HAVE_STAT64___ST_INO && !__ASSUME_ST_INO_64_BIT]:
+       Remove conditional code.
+       * sysdeps/unix/sysv/linux/xstat64.c: Do not include
+       <kernel-features.h>.
+       (___xstat64) [_HAVE_STAT64___ST_INO && !__ASSUME_ST_INO_64_BIT]:
+       Remove conditional code.
+       * sysdeps/unix/sysv/linux/xstatconv.c: Do not include
+       <kernel-features.h>.
+       (__xstat32_conv) [_HAVE_STAT64___ST_INO]: Remove conditional code.
+       [!_HAVE_STAT64___ST_INO]: Make code unconditional.
+
 2018-12-18  Stefan Liebler  <stli@linux.ibm.com>
 
        * sysdeps/s390/multiarch/ifunc-resolve.h
index 402d2573d75794d56829115d4ea05e2d294e1fd1..a1b2430c10a258010156a69acfc73fc2bb351932 100644 (file)
@@ -22,9 +22,6 @@
 
 #include_next <kernel-features.h>
 
-#undef __ASSUME_ST_INO_64_BIT
-#define __ASSUME_ST_INO_64_BIT 0
-
 /* There never has been support for fstat64.  */
 #undef __ASSUME_STATFS64
 #define __ASSUME_STATFS64 0
index b0c52715ccf5bc74eaf60913d6f9ed81beb6504b..fa267a37ccc5fb588d571da763711e9a65b8df25 100644 (file)
@@ -25,7 +25,6 @@
 #include <sysdep.h>
 #include <sys/syscall.h>
 
-#include <kernel-features.h>
 #include <statx_cp.h>
 
 /* Get information about the file FD in BUF.  */
@@ -42,10 +41,6 @@ ___fxstat64 (int vers, int fd, struct stat64 *buf)
                            &tmp);
   if (result == 0)
     __cp_stat64_statx (buf, &tmp);
-#endif
-#if defined _HAVE_STAT64___ST_INO && !__ASSUME_ST_INO_64_BIT
-  if (__builtin_expect (!result, 1) && buf->__st_ino != (__ino_t) buf->st_ino)
-    buf->st_ino = buf->__st_ino;
 #endif
   return result;
 }
index 0ac1616b333a17780171f99b77c1516a6151dae2..911eb96fbeeb15572363017176c49e931a0c47a1 100644 (file)
    introduced.  If somebody cares these values can afterwards be
    corrected.  */
 
-/* The changed st_ino field appeared in 2.4.0-test6.  However, SH is lame,
-   and still does not have a 64-bit inode field.  */
-#define __ASSUME_ST_INO_64_BIT         1
-
 /* The statfs64 syscalls are available in 2.5.74 (but not for alpha).  */
 #define __ASSUME_STATFS64      1
 
index d05fa1453740e07b36e154e0d9239e6b24b27acd..389418276fb19d8c1be952fe98b84f7cb71b93a6 100644 (file)
 #include <sysdep.h>
 #include <sys/syscall.h>
 
-#include <kernel-features.h>
-
 /* Get information about the file NAME in BUF.  */
 int
 ___lxstat64 (int vers, const char *name, struct stat64 *buf)
 {
   int result;
   result = INLINE_SYSCALL (lstat64, 2, name, buf);
-#if defined _HAVE_STAT64___ST_INO && !__ASSUME_ST_INO_64_BIT
-  if (__builtin_expect (!result, 1) && buf->__st_ino != (__ino_t) buf->st_ino)
-    buf->st_ino = buf->__st_ino;
-#endif
   return result;
 }
 
index 8b9ff0c445868cdfdc157ed631557a1fb92af3c4..1e37582ab1bec930281356d7240aabdfa0f3876a 100644 (file)
 
 #include_next <kernel-features.h>
 
-/* SH does not have a 64-bit inode field.  */
-#undef __ASSUME_ST_INO_64_BIT
-#define __ASSUME_ST_INO_64_BIT 0
-
 /* SH4 ABI does not really require argument alignment for 64-bits, but
    the kernel interface for p{read,write}64 adds a dummy long argument
    before the offset.  */
index afc9ba2cb74aa2ee69c1a328c14624a4ebca863b..78c8c61fa7aad51088ccb8ea74771bc4735164d3 100644 (file)
@@ -24,8 +24,6 @@
 #include <sysdep.h>
 #include <sys/syscall.h>
 
-#include <kernel-features.h>
-
 /* Get information about the file NAME in BUF.  */
 
 int
@@ -33,10 +31,6 @@ ___xstat64 (int vers, const char *name, struct stat64 *buf)
 {
   int result;
   result = INLINE_SYSCALL (stat64, 2, name, buf);
-#if defined _HAVE_STAT64___ST_INO && !__ASSUME_ST_INO_64_BIT
-  if (__builtin_expect (!result, 1) && buf->__st_ino != (__ino_t) buf->st_ino)
-    buf->st_ino = buf->__st_ino;
-#endif
   return result;
 }
 
index 3c32da70b166986723e684fb76ec67e5446a2029..36da27329ae9faa2df036191a9e82b7108f94c18 100644 (file)
@@ -19,7 +19,6 @@
 #include <errno.h>
 #include <sys/stat.h>
 #include <kernel_stat.h>
-#include <kernel-features.h>
 
 #ifdef STAT_IS_KERNEL_STAT
 
@@ -189,24 +188,10 @@ __xstat32_conv (int vers, struct stat64 *kbuf, struct stat *buf)
 #ifdef _HAVE_STAT___PAD1
        buf->__pad1 = 0;
 #endif
-#ifdef _HAVE_STAT64___ST_INO
-# if !__ASSUME_ST_INO_64_BIT
-       if (kbuf->st_ino == 0)
-         buf->st_ino = kbuf->__st_ino;
-       else
-# endif
-         {
-           buf->st_ino = kbuf->st_ino;
-           if (sizeof (buf->st_ino) != sizeof (kbuf->st_ino)
-               && buf->st_ino != kbuf->st_ino)
-             return INLINE_SYSCALL_ERROR_RETURN_VALUE (EOVERFLOW);
-         }
-#else
        buf->st_ino = kbuf->st_ino;
        if (sizeof (buf->st_ino) != sizeof (kbuf->st_ino)
            && buf->st_ino != kbuf->st_ino)
          return INLINE_SYSCALL_ERROR_RETURN_VALUE (EOVERFLOW);
-#endif
        buf->st_mode = kbuf->st_mode;
        buf->st_nlink = kbuf->st_nlink;
        buf->st_uid = kbuf->st_uid;