asm-generic: Drop renameat syscall from default list
Subsystems (6)
PATCH v2 1/1 asm-generic: Drop renameat syscall from default list
The newer renameat2 syscall provides all the functionality provided by the renameat syscall and adds flags, so future architectures won't need to include renameat.
Therefore drop the renameat syscall from the generic syscall list unless __ARCH_WANT_RENAMEAT is defined by the architecture's unistd.h prior to including asm-generic/unistd.h, and adjust all architectures using the generic syscall list to define it so that no in-tree architectures are affected.
---
I just found this patch on an old branch, it appears to have slipped through the cracks. Time for a respon.
Changes in v2:
- Rebase onto v4.6-rc5.
- Add __ARCH_WANT_RENAMEAT to h8300 and nios2 arches too.
--- arch/arc/include/uapi/asm/unistd.h | 1 + arch/arm64/include/uapi/asm/unistd.h | 3 +++ arch/c6x/include/uapi/asm/unistd.h | 1 + arch/h8300/include/uapi/asm/unistd.h | 2 ++ arch/hexagon/include/uapi/asm/unistd.h | 1 + arch/metag/include/uapi/asm/unistd.h | 2 ++ arch/nios2/include/uapi/asm/unistd.h | 2 ++ arch/openrisc/include/uapi/asm/unistd.h | 1 + arch/score/include/uapi/asm/unistd.h | 1 + arch/tile/include/uapi/asm/unistd.h | 1 + arch/unicore32/include/uapi/asm/unistd.h | 2 ++ include/uapi/asm-generic/unistd.h | 3 +++ 12 files changed, 20 insertions(+)
arch/arc/include/uapi/asm/unistd.h +1 -0
@@ -15,6 +15,7 @@#if !defined(_UAPI_ASM_ARC_UNISTD_H) || defined(__SYSCALL)#define _UAPI_ASM_ARC_UNISTD_H +#define __ARCH_WANT_RENAMEAT#define __ARCH_WANT_SYS_EXECVE#define __ARCH_WANT_SYS_CLONE#define __ARCH_WANT_SYS_VFORK
arch/arm64/include/uapi/asm/unistd.h +3 -0
@@ -13,4 +13,7 @@* You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#define __ARCH_WANT_RENAMEAT +#include <asm-generic/unistd.h>
arch/c6x/include/uapi/asm/unistd.h +1 -0
@@ -14,6 +14,7 @@* more details. */ +#define __ARCH_WANT_RENAMEAT#define __ARCH_WANT_SYS_CLONE/* Use the standard ABI for syscalls. */
arch/h8300/include/uapi/asm/unistd.h +2 -0
@@ -1,3 +1,5 @@#define __ARCH_NOMMU +#define __ARCH_WANT_RENAMEAT +#include <asm-generic/unistd.h>
arch/hexagon/include/uapi/asm/unistd.h +1 -0
@@ -27,6 +27,7 @@*/ #define sys_mmap2 sys_mmap_pgoff +#define __ARCH_WANT_RENAMEAT#define __ARCH_WANT_SYS_EXECVE#define __ARCH_WANT_SYS_CLONE#define __ARCH_WANT_SYS_VFORK
arch/metag/include/uapi/asm/unistd.h +2 -0
@@ -7,6 +7,8 @@* (at your option) any later version. */ +#define __ARCH_WANT_RENAMEAT +/* Use the standard ABI for syscalls. */ #include <asm-generic/unistd.h>
arch/nios2/include/uapi/asm/unistd.h +2 -0
@@ -17,6 +17,8 @@#define sys_mmap2 sys_mmap_pgoff +#define __ARCH_WANT_RENAMEAT +/* Use the standard ABI for syscalls */ #include <asm-generic/unistd.h>
arch/openrisc/include/uapi/asm/unistd.h +1 -0
@@ -20,6 +20,7 @@#define sys_mmap2 sys_mmap_pgoff +#define __ARCH_WANT_RENAMEAT#define __ARCH_WANT_SYS_FORK#define __ARCH_WANT_SYS_CLONE
arch/score/include/uapi/asm/unistd.h +1 -0
@@ -1,5 +1,6 @@#define __ARCH_HAVE_MMU +#define __ARCH_WANT_RENAMEAT#define __ARCH_WANT_SYSCALL_NO_AT#define __ARCH_WANT_SYSCALL_NO_FLAGS#define __ARCH_WANT_SYSCALL_OFF_T
arch/tile/include/uapi/asm/unistd.h +1 -0
@@ -12,6 +12,7 @@* more details. */ +#define __ARCH_WANT_RENAMEAT#if !defined(__LP64__) || defined(__SYSCALL_COMPAT)/* Use the flavor of this syscall that matches the 32-bit API better. */ #define __ARCH_WANT_SYNC_FILE_RANGE2
arch/unicore32/include/uapi/asm/unistd.h +2 -0
@@ -10,6 +10,8 @@* published by the Free Software Foundation. */ +#define __ARCH_WANT_RENAMEAT +/* Use the standard ABI for syscalls. */ #include <asm-generic/unistd.h> #define __ARCH_WANT_SYS_CLONE
include/uapi/asm-generic/unistd.h +3 -0
@@ -127,8 +127,11 @@ __SYSCALL(__NR_unlinkat, sys_unlinkat) __SYSCALL(__NR_symlinkat, sys_symlinkat)#define __NR_linkat 37 __SYSCALL(__NR_linkat, sys_linkat) +#ifdef __ARCH_WANT_RENAMEAT +/* renameat is superseded with flags by renameat2 */ #define __NR_renameat 38 __SYSCALL(__NR_renameat, sys_renameat) +#endif /* __ARCH_WANT_RENAMEAT */ /* fs/namespace.c */ #define __NR_umount2 39
Signature · 1 line
2.4.10
Quoted 38 lines · James Hogan
The newer renameat2 syscall provides all the functionality provided by the renameat syscall and adds flags, so future architectures won't need to include renameat.
Therefore drop the renameat syscall from the generic syscall list unless
__ARCH_WANT_RENAMEATis defined by the architecture'sunistd.hprior to includingasm-generic/unistd.h, and adjust all architectures using the generic syscall list to define it so that no in-tree architectures are affected.Signed-off-by James Hogan <[email protected]>Cc Arnd Bergmann <[email protected]>Cc Vineet Gupta <[email protected]>Cc Catalin Marinas <[email protected]>Cc Will Deacon <[email protected]>Cc Mark Salter <[email protected]>Cc Aurelien Jacquiot <[email protected]>Cc Richard Kuo <[email protected]>Cc Jonas Bonn <[email protected]>Cc Chen Liqin <[email protected]>Cc Lennox Wu <[email protected]>Cc Chris Metcalf <[email protected]>Cc Guan Xuetao <[email protected]>Cc Ley Foon Tan <[email protected]>Cc Yoshinori Sato <[email protected]>---
I just found this patch on an old branch, it appears to have slipped through the cracks. Time for a respon.
Quoted 5 lines
Changes in v2:
- Rebase onto v4.6-rc5.
- Add__ARCH_WANT_RENAMEATto h8300 and nios2 arches too.--- arch/arc/include/uapi/asm/unistd.h | 1 +
Arnd Bergmann
AppliedQuoted 11 lines · On Monday 02 May 2016 05:13:46 Vineet Gupta wrote:
Quoted 10 lines · James Hogan
The newer renameat2 syscall provides all the functionality provided by the renameat syscall and adds flags, so future architectures won't need to include renameat.
Therefore drop the renameat syscall from the generic syscall list unless
__ARCH_WANT_RENAMEATis defined by the architecture'sunistd.hprior to includingasm-generic/unistd.h, and adjust all architectures using the generic syscall list to define it so that no in-tree architectures are affected.
Quoted 3 lines
Quoted 1 line
Signed-off-by James Hogan <[email protected]>
Applied to the asm-generic, tree, thanks!
Arnd