]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
compat: let architectures define __ARCH_WANT_COMPAT_SYS_GETDENTS64
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Mon, 3 Mar 2014 09:44:03 +0000 (10:44 +0100)
committerHeiko Carstens <heiko.carstens@de.ibm.com>
Tue, 4 Mar 2014 08:05:33 +0000 (09:05 +0100)
For architecture dependent compat syscalls in common code an architecture
must define something like __ARCH_WANT_<WHATEVER> if it wants to use the
code.
This however is not true for compat_sys_getdents64 for which architectures
must define __ARCH_OMIT_COMPAT_SYS_GETDENTS64 if they do not want the code.

This leads to the situation where all architectures, except mips, get the
compat code but only x86_64, arm64 and the generic syscall architectures
actually use it.

So invert the logic, so that architectures actively must do something to
get the compat code.

This way a couple of architectures get rid of otherwise dead code.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
arch/arm64/include/asm/unistd.h
arch/mips/include/asm/unistd.h
arch/x86/include/asm/unistd.h
fs/compat.c
include/linux/compat.h
include/uapi/asm-generic/unistd.h

index 82ce217e94cf07228e52ebbfae9e9bcdeb751de1..a4654c656a1eda3c07f682a8eda7acdfd8e18a31 100644 (file)
@@ -14,6 +14,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #ifdef CONFIG_COMPAT
+#define __ARCH_WANT_COMPAT_SYS_GETDENTS64
 #define __ARCH_WANT_COMPAT_STAT64
 #define __ARCH_WANT_SYS_GETHOSTNAME
 #define __ARCH_WANT_SYS_PAUSE
index 4d3b92886665799d2ca2b746d8efc310cc0c1168..413d6c612bec059e0e5579d3167d67e6bb8e7ad0 100644 (file)
@@ -24,7 +24,6 @@
 
 #ifndef __ASSEMBLY__
 
-#define __ARCH_OMIT_COMPAT_SYS_GETDENTS64
 #define __ARCH_WANT_OLD_READDIR
 #define __ARCH_WANT_SYS_ALARM
 #define __ARCH_WANT_SYS_GETHOSTNAME
index c2a48139c3401b5d0202a83c676242119106b1f2..f4b5795d7e340e39a74f2d9586555f9e2264d20f 100644 (file)
@@ -23,6 +23,7 @@
 #  include <asm/unistd_64.h>
 #  include <asm/unistd_64_x32.h>
 #  define __ARCH_WANT_COMPAT_SYS_TIME
+#  define __ARCH_WANT_COMPAT_SYS_GETDENTS64
 
 # endif
 
index 6af20de2c1a3c29d5cc7c251d8fb3fa2182de445..0095a6978eef16d82bcfe7549017614ed1a3b0b0 100644 (file)
@@ -981,7 +981,7 @@ asmlinkage long compat_sys_getdents(unsigned int fd,
        return error;
 }
 
-#ifndef __ARCH_OMIT_COMPAT_SYS_GETDENTS64
+#ifdef __ARCH_WANT_COMPAT_SYS_GETDENTS64
 
 struct compat_getdents_callback64 {
        struct dir_context ctx;
@@ -1066,7 +1066,7 @@ asmlinkage long compat_sys_getdents64(unsigned int fd,
        fdput(f);
        return error;
 }
-#endif /* ! __ARCH_OMIT_COMPAT_SYS_GETDENTS64 */
+#endif /* __ARCH_WANT_COMPAT_SYS_GETDENTS64 */
 
 /*
  * Exactly like fs/open.c:sys_open(), except that it doesn't set the
index 3f448c65511b525ae9d92c38d7201f087b568334..beded18f992dd311b00d4bb859900c3f7b09693c 100644 (file)
@@ -502,9 +502,11 @@ asmlinkage long compat_sys_old_readdir(unsigned int fd,
 asmlinkage long compat_sys_getdents(unsigned int fd,
                                    struct compat_linux_dirent __user *dirent,
                                    unsigned int count);
+#ifdef __ARCH_WANT_COMPAT_SYS_GETDENTS64
 asmlinkage long compat_sys_getdents64(unsigned int fd,
                                      struct linux_dirent64 __user *dirent,
                                      unsigned int count);
+#endif
 asmlinkage long compat_sys_vmsplice(int fd, const struct compat_iovec __user *,
                                    unsigned int nr_segs, unsigned int flags);
 asmlinkage long compat_sys_open(const char __user *filename, int flags,
index dde8041f40d2e8a29a25a6205dd38577f2b46bce..6db66783d268d9a286a86b836c9277bd89f5ac13 100644 (file)
@@ -191,6 +191,7 @@ __SYSCALL(__NR_quotactl, sys_quotactl)
 
 /* fs/readdir.c */
 #define __NR_getdents64 61
+#define __ARCH_WANT_COMPAT_SYS_GETDENTS64
 __SC_COMP(__NR_getdents64, sys_getdents64, compat_sys_getdents64)
 
 /* fs/read_write.c */