Skip to contentSkip to conversation

syscalls: Fix file path names in the header comments

PATCH In review Sohil Mehta 3 participants 8 messages Jun 16, 2023 – Jun 23, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 syscalls: Fix file path names in the header comments

Some of the syscall definitions have moved due to the original source file being moved into a sub-directory. Update the file path names to reflect that.

A couple of syscalls such as lookup_dcookie() and nfsservctl() don't have a syscall definition anymore. Clear the filename and leave the original subsystem name intact for reference.

---

Arguably, having filenames in comments might not be the best idea. If the intention is to make it easier to find a syscall definition, it is probably faster to just use 'git grep SYSCALL_DEFINE | grep <syscall_name>'. Please let me know if it would be preferable to just get rid of these comments all together.

---
 include/linux/compat.h                  | 12 ++++++------
 include/linux/syscalls.h                | 24 +++++++++++------------
 include/uapi/asm-generic/unistd.h       | 24 +++++++++++------------
 kernel/sys_ni.c                         | 26 +++++++++++--------------
 tools/include/uapi/asm-generic/unistd.h | 24 +++++++++++------------
 5 files changed, 52 insertions(+), 58 deletions(-)
include/linux/compat.h +6 -6
index 44b1736c95b5..21a659870f7f 100644
@@ -582,7 +582,7 @@ asmlinkage long compat_sys_io_pgetevents_time64(compat_aio_context_t ctx_id,
 					struct __kernel_timespec __user *timeout,
 					const struct __compat_aio_sigset __user *usig);
 
-/* fs/cookies.c */
+/* fs/ */
 asmlinkage long compat_sys_lookup_dcookie(u32, u32, char __user *, compat_size_t);
 
 /* fs/eventpoll.c */
@@ -650,7 +650,7 @@ asmlinkage long compat_sys_pwritev64(unsigned long fd,
 		unsigned long vlen, loff_t pos);
 #endif
 
-/* fs/sendfile.c */
+/* fs/read_write.c */
 asmlinkage long compat_sys_sendfile(int out_fd, int in_fd,
 				    compat_off_t __user *offset, compat_size_t count);
 asmlinkage long compat_sys_sendfile64(int out_fd, int in_fd,
@@ -708,7 +708,7 @@ asmlinkage long
 compat_sys_get_robust_list(int pid, compat_uptr_t __user *head_ptr,
 			   compat_size_t __user *len_ptr);
 
-/* kernel/itimer.c */
+/* kernel/time/itimer.c */
 asmlinkage long compat_sys_getitimer(int which,
 				     struct old_itimerval32 __user *it);
 asmlinkage long compat_sys_setitimer(int which,
@@ -721,7 +721,7 @@ asmlinkage long compat_sys_kexec_load(compat_ulong_t entry,
 				      struct compat_kexec_segment __user *,
 				      compat_ulong_t flags);
 
-/* kernel/posix-timers.c */
+/* kernel/time/posix-timers.c */
 asmlinkage long compat_sys_timer_create(clockid_t which_clock,
 			struct compat_sigevent __user *timer_event_spec,
 			timer_t __user *created_timer_id);
@@ -772,13 +772,13 @@ asmlinkage long compat_sys_setrlimit(unsigned int resource,
 				     struct compat_rlimit __user *rlim);
 asmlinkage long compat_sys_getrusage(int who, struct compat_rusage __user *ru);
 
-/* kernel/time.c */
+/* kernel/time/time.c */
 asmlinkage long compat_sys_gettimeofday(struct old_timeval32 __user *tv,
 		struct timezone __user *tz);
 asmlinkage long compat_sys_settimeofday(struct old_timeval32 __user *tv,
 		struct timezone __user *tz);
 
-/* kernel/timer.c */
+/* kernel/sys.c */
 asmlinkage long compat_sys_sysinfo(struct compat_sysinfo __user *info);
 
 /* ipc/mqueue.c */
include/linux/syscalls.h +11 -13
index 33a0ee3bcb2e..c53688211f5c 100644
@@ -374,7 +374,7 @@ asmlinkage long sys_fremovexattr(int fd, const char __user *name);
 /* fs/dcache.c */
 asmlinkage long sys_getcwd(char __user *buf, unsigned long size);
 
-/* fs/cookies.c */
+/* fs/ */
 asmlinkage long sys_lookup_dcookie(u64 cookie64, char __user *buf, size_t len);
 
 /* fs/eventfd.c */
@@ -403,7 +403,7 @@ asmlinkage long sys_fcntl64(unsigned int fd,
 				unsigned int cmd, unsigned long arg);
 #endif
 
-/* fs/inotify_user.c */
+/* fs/notify/inotify/inotify_user.c */
 asmlinkage long sys_inotify_init1(int flags);
 asmlinkage long sys_inotify_add_watch(int fd, const char __user *path,
 					u32 mask);
@@ -413,7 +413,7 @@ asmlinkage long sys_inotify_rm_watch(int fd, __s32 wd);
 asmlinkage long sys_ioctl(unsigned int fd, unsigned int cmd,
 				unsigned long arg);
 
-/* fs/ioprio.c */
+/* block/ioprio.c */
 asmlinkage long sys_ioprio_set(int which, int who, int ioprio);
 asmlinkage long sys_ioprio_get(int which, int who);
 
@@ -440,8 +440,6 @@ asmlinkage long sys_mount(char __user *dev_name, char __user *dir_name,
 asmlinkage long sys_pivot_root(const char __user *new_root,
 				const char __user *put_old);
 
-/* fs/nfsctl.c */
-
 /* fs/open.c */
 asmlinkage long sys_statfs(const char __user * path,
 				struct statfs __user *buf);
@@ -481,7 +479,7 @@ asmlinkage long sys_vhangup(void);
 /* fs/pipe.c */
 asmlinkage long sys_pipe2(int __user *fildes, int flags);
 
-/* fs/quota.c */
+/* fs/quota/quota.c */
 asmlinkage long sys_quotactl(unsigned int cmd, const char __user *special,
 				qid_t id, void __user *addr);
 asmlinkage long sys_quotactl_fd(unsigned int fd, unsigned int cmd, qid_t id,
@@ -516,7 +514,7 @@ asmlinkage long sys_preadv(unsigned long fd, const struct iovec __user *vec,
 asmlinkage long sys_pwritev(unsigned long fd, const struct iovec __user *vec,
 			    unsigned long vlen, unsigned long pos_l, unsigned long pos_h);
 
-/* fs/sendfile.c */
+/* fs/read_write.c */
 asmlinkage long sys_sendfile64(int out_fd, int in_fd,
 			       loff_t __user *offset, size_t count);
 
@@ -626,13 +624,13 @@ asmlinkage long sys_futex_waitv(struct futex_waitv *waiters,
 				unsigned int nr_futexes, unsigned int flags,
 				struct __kernel_timespec __user *timeout, clockid_t clockid);
 
-/* kernel/hrtimer.c */
+/* kernel/time/hrtimer.c */
 asmlinkage long sys_nanosleep(struct __kernel_timespec __user *rqtp,
 			      struct __kernel_timespec __user *rmtp);
 asmlinkage long sys_nanosleep_time32(struct old_timespec32 __user *rqtp,
 				     struct old_timespec32 __user *rmtp);
 
-/* kernel/itimer.c */
+/* kernel/time/itimer.c */
 asmlinkage long sys_getitimer(int which, struct __kernel_old_itimerval __user *value);
 asmlinkage long sys_setitimer(int which,
 				struct __kernel_old_itimerval __user *value,
@@ -643,13 +641,13 @@ asmlinkage long sys_kexec_load(unsigned long entry, unsigned long nr_segments,
 				struct kexec_segment __user *segments,
 				unsigned long flags);
 
-/* kernel/module.c */
+/* kernel/module/main.c */
 asmlinkage long sys_init_module(void __user *umod, unsigned long len,
 				const char __user *uargs);
 asmlinkage long sys_delete_module(const char __user *name_user,
 				unsigned int flags);
 
-/* kernel/posix-timers.c */
+/* kernel/time/posix-timers.c */
 asmlinkage long sys_timer_create(clockid_t which_clock,
 				 struct sigevent __user *timer_event_spec,
 				 timer_t __user * created_timer_id);
@@ -684,7 +682,7 @@ asmlinkage long sys_clock_nanosleep_time32(clockid_t which_clock, int flags,
 				struct old_timespec32 __user *rqtp,
 				struct old_timespec32 __user *rmtp);
 
-/* kernel/printk.c */
+/* kernel/printk/printk.c */
 asmlinkage long sys_syslog(int type, char __user *buf, int len);
 
 /* kernel/ptrace.c */
@@ -773,7 +771,7 @@ asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3,
 			unsigned long arg4, unsigned long arg5);
 asmlinkage long sys_getcpu(unsigned __user *cpu, unsigned __user *node, struct getcpu_cache __user *cache);
 
-/* kernel/time.c */
+/* kernel/time/time.c */
 asmlinkage long sys_gettimeofday(struct __kernel_old_timeval __user *tv,
 				struct timezone __user *tz);
 asmlinkage long sys_settimeofday(struct __kernel_old_timeval __user *tv,
include/uapi/asm-generic/unistd.h +12 -12
index 45fa180cc56a..77dc4259dcc1 100644
@@ -73,7 +73,7 @@ __SYSCALL(__NR_fremovexattr, sys_fremovexattr)
 #define __NR_getcwd 17
 __SYSCALL(__NR_getcwd, sys_getcwd)
 
-/* fs/cookies.c */
+/* fs/ */
 #define __NR_lookup_dcookie 18
 __SC_COMP(__NR_lookup_dcookie, sys_lookup_dcookie, compat_sys_lookup_dcookie)
 
@@ -97,7 +97,7 @@ __SYSCALL(__NR_dup3, sys_dup3)
 #define __NR3264_fcntl 25
 __SC_COMP_3264(__NR3264_fcntl, sys_fcntl64, sys_fcntl, compat_sys_fcntl64)
 
-/* fs/inotify_user.c */
+/* fs/notify/inotify/inotify_user.c */
 #define __NR_inotify_init1 26
 __SYSCALL(__NR_inotify_init1, sys_inotify_init1)
 #define __NR_inotify_add_watch 27
@@ -109,7 +109,7 @@ __SYSCALL(__NR_inotify_rm_watch, sys_inotify_rm_watch)
 #define __NR_ioctl 29
 __SC_COMP(__NR_ioctl, sys_ioctl, compat_sys_ioctl)
 
-/* fs/ioprio.c */
+/* block/ioprio.c */
 #define __NR_ioprio_set 30
 __SYSCALL(__NR_ioprio_set, sys_ioprio_set)
 #define __NR_ioprio_get 31
@@ -144,7 +144,7 @@ __SYSCALL(__NR_mount, sys_mount)
 #define __NR_pivot_root 41
 __SYSCALL(__NR_pivot_root, sys_pivot_root)
 
-/* fs/nfsctl.c */
+/* fs/ */
 #define __NR_nfsservctl 42
 __SYSCALL(__NR_nfsservctl, sys_ni_syscall)
 
@@ -191,7 +191,7 @@ __SYSCALL(__NR_vhangup, sys_vhangup)
 #define __NR_pipe2 59
 __SYSCALL(__NR_pipe2, sys_pipe2)
 
-/* fs/quota.c */
+/* fs/quota/quota.c */
 #define __NR_quotactl 60
 __SYSCALL(__NR_quotactl, sys_quotactl)
 
@@ -219,7 +219,7 @@ __SC_COMP(__NR_preadv, sys_preadv, compat_sys_preadv)
 #define __NR_pwritev 70
 __SC_COMP(__NR_pwritev, sys_pwritev, compat_sys_pwritev)
 
-/* fs/sendfile.c */
+/* fs/read_write.c */
 #define __NR3264_sendfile 71
 __SYSCALL(__NR3264_sendfile, sys_sendfile64)
 
@@ -328,13 +328,13 @@ __SC_COMP(__NR_set_robust_list, sys_set_robust_list, \
 __SC_COMP(__NR_get_robust_list, sys_get_robust_list, \
 	  compat_sys_get_robust_list)
 
-/* kernel/hrtimer.c */
+/* kernel/time/hrtimer.c */
 #if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
 #define __NR_nanosleep 101
 __SC_3264(__NR_nanosleep, sys_nanosleep_time32, sys_nanosleep)
 #endif
 
-/* kernel/itimer.c */
+/* kernel/time/itimer.c */
 #define __NR_getitimer 102
 __SC_COMP(__NR_getitimer, sys_getitimer, compat_sys_getitimer)
 #define __NR_setitimer 103
@@ -344,13 +344,13 @@ __SC_COMP(__NR_setitimer, sys_setitimer, compat_sys_setitimer)
 #define __NR_kexec_load 104
 __SC_COMP(__NR_kexec_load, sys_kexec_load, compat_sys_kexec_load)
 
-/* kernel/module.c */
+/* kernel/module/main.c */
 #define __NR_init_module 105
 __SYSCALL(__NR_init_module, sys_init_module)
 #define __NR_delete_module 106
 __SYSCALL(__NR_delete_module, sys_delete_module)
 
-/* kernel/posix-timers.c */
+/* kernel/time/posix-timers.c */
 #define __NR_timer_create 107
 __SC_COMP(__NR_timer_create, sys_timer_create, compat_sys_timer_create)
 #if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
@@ -377,7 +377,7 @@ __SC_3264(__NR_clock_nanosleep, sys_clock_nanosleep_time32, \
 	  sys_clock_nanosleep)
 #endif
 
-/* kernel/printk.c */
+/* kernel/printk/printk.c */
 #define __NR_syslog 116
 __SYSCALL(__NR_syslog, sys_syslog)
 
@@ -507,7 +507,7 @@ __SYSCALL(__NR_prctl, sys_prctl)
 #define __NR_getcpu 168
 __SYSCALL(__NR_getcpu, sys_getcpu)
 
-/* kernel/time.c */
+/* kernel/time/time.c */
 #if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
 #define __NR_gettimeofday 169
 __SC_COMP(__NR_gettimeofday, sys_gettimeofday, compat_sys_gettimeofday)
kernel/sys_ni.c +11 -15
index 860b2dcf3ac4..d64be96409d2 100644
@@ -56,7 +56,7 @@ COND_SYSCALL(io_uring_register);
 
 /* fs/dcache.c */
 
-/* fs/cookies.c */
+/* fs/ */
 COND_SYSCALL(lookup_dcookie);
 COND_SYSCALL_COMPAT(lookup_dcookie);
 
@@ -73,14 +73,14 @@ COND_SYSCALL_COMPAT(epoll_pwait2);
 
 /* fs/fcntl.c */
 
-/* fs/inotify_user.c */
+/* fs/notify/inotify/inotify_user.c */
 COND_SYSCALL(inotify_init1);
 COND_SYSCALL(inotify_add_watch);
 COND_SYSCALL(inotify_rm_watch);
 
 /* fs/ioctl.c */
 
-/* fs/ioprio.c */
+/* block/ioprio.c */
 COND_SYSCALL(ioprio_set);
 COND_SYSCALL(ioprio_get);
 
@@ -91,13 +91,11 @@ COND_SYSCALL(flock);
 
 /* fs/namespace.c */
 
-/* fs/nfsctl.c */
-
 /* fs/open.c */
 
 /* fs/pipe.c */
 
-/* fs/quota.c */
+/* fs/quota/quota.c */
 COND_SYSCALL(quotactl);
 COND_SYSCALL(quotactl_fd);
 
@@ -105,8 +103,6 @@ COND_SYSCALL(quotactl_fd);
 
 /* fs/read_write.c */
 
-/* fs/sendfile.c */
-
 /* fs/select.c */
 
 /* fs/signalfd.c */
@@ -152,21 +148,21 @@ COND_SYSCALL(get_robust_list);
 COND_SYSCALL_COMPAT(get_robust_list);
 COND_SYSCALL(futex_waitv);
 
-/* kernel/hrtimer.c */
+/* kernel/time/hrtimer.c */
 
-/* kernel/itimer.c */
+/* kernel/time/itimer.c */
 
 /* kernel/kexec.c */
 COND_SYSCALL(kexec_load);
 COND_SYSCALL_COMPAT(kexec_load);
 
-/* kernel/module.c */
+/* kernel/module/main.c */
 COND_SYSCALL(init_module);
 COND_SYSCALL(delete_module);
 
-/* kernel/posix-timers.c */
+/* kernel/time/posix-timers.c */
 
-/* kernel/printk.c */
+/* kernel/printk/printk.c */
 COND_SYSCALL(syslog);
 
 /* kernel/ptrace.c */
@@ -187,9 +183,9 @@ COND_SYSCALL(setfsgid);
 COND_SYSCALL(setgroups);
 COND_SYSCALL(getgroups);
 
-/* kernel/time.c */
+/* kernel/time/time.c */
 
-/* kernel/timer.c */
+/* kernel/time/timer.c */
 
 /* ipc/mqueue.c */
 COND_SYSCALL(mq_open);
tools/include/uapi/asm-generic/unistd.h +12 -12
index 45fa180cc56a..77dc4259dcc1 100644
@@ -73,7 +73,7 @@ __SYSCALL(__NR_fremovexattr, sys_fremovexattr)
 #define __NR_getcwd 17
 __SYSCALL(__NR_getcwd, sys_getcwd)
 
-/* fs/cookies.c */
+/* fs/ */
 #define __NR_lookup_dcookie 18
 __SC_COMP(__NR_lookup_dcookie, sys_lookup_dcookie, compat_sys_lookup_dcookie)
 
@@ -97,7 +97,7 @@ __SYSCALL(__NR_dup3, sys_dup3)
 #define __NR3264_fcntl 25
 __SC_COMP_3264(__NR3264_fcntl, sys_fcntl64, sys_fcntl, compat_sys_fcntl64)
 
-/* fs/inotify_user.c */
+/* fs/notify/inotify/inotify_user.c */
 #define __NR_inotify_init1 26
 __SYSCALL(__NR_inotify_init1, sys_inotify_init1)
 #define __NR_inotify_add_watch 27
@@ -109,7 +109,7 @@ __SYSCALL(__NR_inotify_rm_watch, sys_inotify_rm_watch)
 #define __NR_ioctl 29
 __SC_COMP(__NR_ioctl, sys_ioctl, compat_sys_ioctl)
 
-/* fs/ioprio.c */
+/* block/ioprio.c */
 #define __NR_ioprio_set 30
 __SYSCALL(__NR_ioprio_set, sys_ioprio_set)
 #define __NR_ioprio_get 31
@@ -144,7 +144,7 @@ __SYSCALL(__NR_mount, sys_mount)
 #define __NR_pivot_root 41
 __SYSCALL(__NR_pivot_root, sys_pivot_root)
 
-/* fs/nfsctl.c */
+/* fs/ */
 #define __NR_nfsservctl 42
 __SYSCALL(__NR_nfsservctl, sys_ni_syscall)
 
@@ -191,7 +191,7 @@ __SYSCALL(__NR_vhangup, sys_vhangup)
 #define __NR_pipe2 59
 __SYSCALL(__NR_pipe2, sys_pipe2)
 
-/* fs/quota.c */
+/* fs/quota/quota.c */
 #define __NR_quotactl 60
 __SYSCALL(__NR_quotactl, sys_quotactl)
 
@@ -219,7 +219,7 @@ __SC_COMP(__NR_preadv, sys_preadv, compat_sys_preadv)
 #define __NR_pwritev 70
 __SC_COMP(__NR_pwritev, sys_pwritev, compat_sys_pwritev)
 
-/* fs/sendfile.c */
+/* fs/read_write.c */
 #define __NR3264_sendfile 71
 __SYSCALL(__NR3264_sendfile, sys_sendfile64)
 
@@ -328,13 +328,13 @@ __SC_COMP(__NR_set_robust_list, sys_set_robust_list, \
 __SC_COMP(__NR_get_robust_list, sys_get_robust_list, \
 	  compat_sys_get_robust_list)
 
-/* kernel/hrtimer.c */
+/* kernel/time/hrtimer.c */
 #if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
 #define __NR_nanosleep 101
 __SC_3264(__NR_nanosleep, sys_nanosleep_time32, sys_nanosleep)
 #endif
 
-/* kernel/itimer.c */
+/* kernel/time/itimer.c */
 #define __NR_getitimer 102
 __SC_COMP(__NR_getitimer, sys_getitimer, compat_sys_getitimer)
 #define __NR_setitimer 103
@@ -344,13 +344,13 @@ __SC_COMP(__NR_setitimer, sys_setitimer, compat_sys_setitimer)
 #define __NR_kexec_load 104
 __SC_COMP(__NR_kexec_load, sys_kexec_load, compat_sys_kexec_load)
 
-/* kernel/module.c */
+/* kernel/module/main.c */
 #define __NR_init_module 105
 __SYSCALL(__NR_init_module, sys_init_module)
 #define __NR_delete_module 106
 __SYSCALL(__NR_delete_module, sys_delete_module)
 
-/* kernel/posix-timers.c */
+/* kernel/time/posix-timers.c */
 #define __NR_timer_create 107
 __SC_COMP(__NR_timer_create, sys_timer_create, compat_sys_timer_create)
 #if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
@@ -377,7 +377,7 @@ __SC_3264(__NR_clock_nanosleep, sys_clock_nanosleep_time32, \
 	  sys_clock_nanosleep)
 #endif
 
-/* kernel/printk.c */
+/* kernel/printk/printk.c */
 #define __NR_syslog 116
 __SYSCALL(__NR_syslog, sys_syslog)
 
@@ -507,7 +507,7 @@ __SYSCALL(__NR_prctl, sys_prctl)
 #define __NR_getcpu 168
 __SYSCALL(__NR_getcpu, sys_getcpu)
 
-/* kernel/time.c */
+/* kernel/time/time.c */
 #if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
 #define __NR_gettimeofday 169
 __SC_COMP(__NR_gettimeofday, sys_gettimeofday, compat_sys_gettimeofday)
Signature · 1 line
2.34.1
maintainer
#1 lore raw
Quoted 9 lines · Sohil Mehta

Some of the syscall definitions have moved due to the original source file being moved into a sub-directory. Update the file path names to reflect that.

A couple of syscalls such as lookup_dcookie() and nfsservctl() don't have a syscall definition anymore. Clear the filename and leave the original subsystem name intact for reference.

Thanks for going through these!

Quoted 5 lines

Arguably, having filenames in comments might not be the best idea. If the intention is to make it easier to find a syscall definition, it is probably faster to just use 'git grep SYSCALL_DEFINE | grep <syscall_name>'. Please let me know if it would be preferable to just get rid of these comments all together.

It's probably not worth trying to keep the comments in sync, I'd be in favor of just removing them all.

Arnd

#2 lore raw
Quoted 3 lines · Arnd Bergmann

It's probably not worth trying to keep the comments in sync, I'd be in favor of just removing them all.

Great, thanks! I'll spin up a patch to remove them. You can then choose to apply either of them.

Sohil

#3 lore raw

PATCH 1/1 syscalls: Remove file path comments from headers

Source file locations for syscall definitions can change over a period of time. File paths in comments get stale and are hard to maintain long term. Also, their usefulness is questionable since it would be easier to locate a syscall definition using the SYSCALL_DEFINEx() macro.

Remove all source file path comments from the syscall headers. Also, equalize the uneven line spacing (some of which is introduced due to the deletions).

---
 include/linux/compat.h                  |  82 ++------------
 include/linux/syscalls.h                | 140 +++---------------------
 include/uapi/asm-generic/unistd.h       | 129 +++++-----------------
 kernel/sys_ni.c                         | 110 +------------------
 tools/include/uapi/asm-generic/unistd.h | 129 +++++-----------------
 5 files changed, 85 insertions(+), 505 deletions(-)
include/linux/compat.h +9 -73
index 44b1736c95b5..1cfa4f0f490a 100644
@@ -581,11 +581,7 @@ asmlinkage long compat_sys_io_pgetevents_time64(compat_aio_context_t ctx_id,
 					struct io_event __user *events,
 					struct __kernel_timespec __user *timeout,
 					const struct __compat_aio_sigset __user *usig);
-
-/* fs/cookies.c */
 asmlinkage long compat_sys_lookup_dcookie(u32, u32, char __user *, compat_size_t);
-
-/* fs/eventpoll.c */
 asmlinkage long compat_sys_epoll_pwait(int epfd,
 			struct epoll_event __user *events,
 			int maxevents, int timeout,
@@ -597,18 +593,12 @@ asmlinkage long compat_sys_epoll_pwait2(int epfd,
 			const struct __kernel_timespec __user *timeout,
 			const compat_sigset_t __user *sigmask,
 			compat_size_t sigsetsize);
-
-/* fs/fcntl.c */
 asmlinkage long compat_sys_fcntl(unsigned int fd, unsigned int cmd,
 				 compat_ulong_t arg);
 asmlinkage long compat_sys_fcntl64(unsigned int fd, unsigned int cmd,
 				   compat_ulong_t arg);
-
-/* fs/ioctl.c */
 asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd,
 				 compat_ulong_t arg);
-
-/* fs/open.c */
 asmlinkage long compat_sys_statfs(const char __user *pathname,
 				  struct compat_statfs __user *buf);
 asmlinkage long compat_sys_statfs64(const char __user *pathname,
@@ -623,13 +613,9 @@ asmlinkage long compat_sys_ftruncate(unsigned int, compat_ulong_t);
 /* No generic prototype for truncate64, ftruncate64, fallocate */
 asmlinkage long compat_sys_openat(int dfd, const char __user *filename,
 				  int flags, umode_t mode);
-
-/* fs/readdir.c */
 asmlinkage long compat_sys_getdents(unsigned int fd,
 				    struct compat_linux_dirent __user *dirent,
 				    unsigned int count);
-
-/* fs/read_write.c */
 asmlinkage long compat_sys_lseek(unsigned int, compat_off_t, unsigned int);
 /* No generic prototype for pread64 and pwrite64 */
 asmlinkage ssize_t compat_sys_preadv(compat_ulong_t fd,
@@ -649,14 +635,10 @@ asmlinkage long compat_sys_pwritev64(unsigned long fd,
 		const struct iovec __user *vec,
 		unsigned long vlen, loff_t pos);
 #endif
-
-/* fs/sendfile.c */
 asmlinkage long compat_sys_sendfile(int out_fd, int in_fd,
 				    compat_off_t __user *offset, compat_size_t count);
 asmlinkage long compat_sys_sendfile64(int out_fd, int in_fd,
 				    compat_loff_t __user *offset, compat_size_t count);
-
-/* fs/select.c */
 asmlinkage long compat_sys_pselect6_time32(int n, compat_ulong_t __user *inp,
 				    compat_ulong_t __user *outp,
 				    compat_ulong_t __user *exp,
@@ -677,68 +659,45 @@ asmlinkage long compat_sys_ppoll_time64(struct pollfd __user *ufds,
 				 struct __kernel_timespec __user *tsp,
 				 const compat_sigset_t __user *sigmask,
 				 compat_size_t sigsetsize);
-
-/* fs/signalfd.c */
 asmlinkage long compat_sys_signalfd4(int ufd,
 				     const compat_sigset_t __user *sigmask,
 				     compat_size_t sigsetsize, int flags);
-
-/* fs/stat.c */
 asmlinkage long compat_sys_newfstatat(unsigned int dfd,
 				      const char __user *filename,
 				      struct compat_stat __user *statbuf,
 				      int flag);
 asmlinkage long compat_sys_newfstat(unsigned int fd,
 				    struct compat_stat __user *statbuf);
-
-/* fs/sync.c: No generic prototype for sync_file_range and sync_file_range2 */
-
-/* kernel/exit.c */
+/* No generic prototype for sync_file_range and sync_file_range2 */
 asmlinkage long compat_sys_waitid(int, compat_pid_t,
 		struct compat_siginfo __user *, int,
 		struct compat_rusage __user *);
-
-
-
-/* kernel/futex.c */
 asmlinkage long
 compat_sys_set_robust_list(struct compat_robust_list_head __user *head,
 			   compat_size_t len);
 asmlinkage long
 compat_sys_get_robust_list(int pid, compat_uptr_t __user *head_ptr,
 			   compat_size_t __user *len_ptr);
-
-/* kernel/itimer.c */
 asmlinkage long compat_sys_getitimer(int which,
 				     struct old_itimerval32 __user *it);
 asmlinkage long compat_sys_setitimer(int which,
 				     struct old_itimerval32 __user *in,
 				     struct old_itimerval32 __user *out);
-
-/* kernel/kexec.c */
 asmlinkage long compat_sys_kexec_load(compat_ulong_t entry,
 				      compat_ulong_t nr_segments,
 				      struct compat_kexec_segment __user *,
 				      compat_ulong_t flags);
-
-/* kernel/posix-timers.c */
 asmlinkage long compat_sys_timer_create(clockid_t which_clock,
 			struct compat_sigevent __user *timer_event_spec,
 			timer_t __user *created_timer_id);
-
-/* kernel/ptrace.c */
 asmlinkage long compat_sys_ptrace(compat_long_t request, compat_long_t pid,
 				  compat_long_t addr, compat_long_t data);
-
-/* kernel/sched/core.c */
 asmlinkage long compat_sys_sched_setaffinity(compat_pid_t pid,
 				     unsigned int len,
 				     compat_ulong_t __user *user_mask_ptr);
 asmlinkage long compat_sys_sched_getaffinity(compat_pid_t pid,
 				     unsigned int len,
 				     compat_ulong_t __user *user_mask_ptr);
-
-/* kernel/signal.c */
 asmlinkage long compat_sys_sigaltstack(const compat_stack_t __user *uss_ptr,
 				       compat_stack_t __user *uoss_ptr);
 asmlinkage long compat_sys_rt_sigsuspend(compat_sigset_t __user *unewset,
@@ -763,25 +722,17 @@ asmlinkage long compat_sys_rt_sigtimedwait_time64(compat_sigset_t __user *uthese
 asmlinkage long compat_sys_rt_sigqueueinfo(compat_pid_t pid, int sig,
 				struct compat_siginfo __user *uinfo);
 /* No generic prototype for rt_sigreturn */
-
-/* kernel/sys.c */
 asmlinkage long compat_sys_times(struct compat_tms __user *tbuf);
 asmlinkage long compat_sys_getrlimit(unsigned int resource,
 				     struct compat_rlimit __user *rlim);
 asmlinkage long compat_sys_setrlimit(unsigned int resource,
 				     struct compat_rlimit __user *rlim);
 asmlinkage long compat_sys_getrusage(int who, struct compat_rusage __user *ru);
-
-/* kernel/time.c */
 asmlinkage long compat_sys_gettimeofday(struct old_timeval32 __user *tv,
 		struct timezone __user *tz);
 asmlinkage long compat_sys_settimeofday(struct old_timeval32 __user *tv,
 		struct timezone __user *tz);
-
-/* kernel/timer.c */
 asmlinkage long compat_sys_sysinfo(struct compat_sysinfo __user *info);
-
-/* ipc/mqueue.c */
 asmlinkage long compat_sys_mq_open(const char __user *u_name,
 			int oflag, compat_mode_t mode,
 			struct compat_mq_attr __user *u_attr);
@@ -790,22 +741,14 @@ asmlinkage long compat_sys_mq_notify(mqd_t mqdes,
 asmlinkage long compat_sys_mq_getsetattr(mqd_t mqdes,
 			const struct compat_mq_attr __user *u_mqstat,
 			struct compat_mq_attr __user *u_omqstat);
-
-/* ipc/msg.c */
 asmlinkage long compat_sys_msgctl(int first, int second, void __user *uptr);
 asmlinkage long compat_sys_msgrcv(int msqid, compat_uptr_t msgp,
 		compat_ssize_t msgsz, compat_long_t msgtyp, int msgflg);
 asmlinkage long compat_sys_msgsnd(int msqid, compat_uptr_t msgp,
 		compat_ssize_t msgsz, int msgflg);
-
-/* ipc/sem.c */
 asmlinkage long compat_sys_semctl(int semid, int semnum, int cmd, int arg);
-
-/* ipc/shm.c */
 asmlinkage long compat_sys_shmctl(int first, int second, void __user *uptr);
 asmlinkage long compat_sys_shmat(int shmid, compat_uptr_t shmaddr, int shmflg);
-
-/* net/socket.c */
 asmlinkage long compat_sys_recvfrom(int fd, void __user *buf, compat_size_t len,
 			    unsigned flags, struct sockaddr __user *addr,
 			    int __user *addrlen);
@@ -813,20 +756,13 @@ asmlinkage long compat_sys_sendmsg(int fd, struct compat_msghdr __user *msg,
 				   unsigned flags);
 asmlinkage long compat_sys_recvmsg(int fd, struct compat_msghdr __user *msg,
 				   unsigned int flags);
-
-/* mm/filemap.c: No generic prototype for readahead */
-
-/* security/keys/keyctl.c */
+/* No generic prototype for readahead */
 asmlinkage long compat_sys_keyctl(u32 option,
 			      u32 arg2, u32 arg3, u32 arg4, u32 arg5);
-
-/* arch/example/kernel/sys_example.c */
 asmlinkage long compat_sys_execve(const char __user *filename, const compat_uptr_t __user *argv,
 		     const compat_uptr_t __user *envp);
-
-/* mm/fadvise.c: No generic prototype for fadvise64_64 */
-
-/* mm/, CONFIG_MMU only */
+/* No generic prototype for fadvise64_64 */
+/* CONFIG_MMU only */
 asmlinkage long compat_sys_rt_tgsigqueueinfo(compat_pid_t tgid,
 					compat_pid_t pid, int sig,
 					struct compat_siginfo __user *uinfo);
@@ -896,18 +832,18 @@ asmlinkage long compat_sys_ustat(unsigned dev, struct compat_ustat __user *u32);
 asmlinkage long compat_sys_recv(int fd, void __user *buf, compat_size_t len,
 				unsigned flags);
 
-/* obsolete: fs/readdir.c */
+/* obsolete */
 asmlinkage long compat_sys_old_readdir(unsigned int fd,
 				       struct compat_old_linux_dirent __user *,
 				       unsigned int count);
 
-/* obsolete: fs/select.c */
+/* obsolete */
 asmlinkage long compat_sys_old_select(struct compat_sel_arg_struct __user *arg);
 
-/* obsolete: ipc */
+/* obsolete */
 asmlinkage long compat_sys_ipc(u32, int, int, u32, compat_uptr_t, u32);
 
-/* obsolete: kernel/signal.c */
+/* obsolete */
 #ifdef __ARCH_WANT_SYS_SIGPENDING
 asmlinkage long compat_sys_sigpending(compat_old_sigset_t __user *set);
 #endif
@@ -922,7 +858,7 @@ asmlinkage long compat_sys_sigaction(int sig,
                                    struct compat_old_sigaction __user *oact);
 #endif
 
-/* obsolete: net/socket.c */
+/* obsolete */
 asmlinkage long compat_sys_socketcall(int call, u32 __user *args);
 
 #ifdef __ARCH_WANT_COMPAT_TRUNCATE64
include/linux/syscalls.h +15 -125

438 lines not on this page · raw message

include/uapi/asm-generic/unistd.h +30 -99

516 lines not on this page · raw message

kernel/sys_ni.c +1 -109

203 lines not on this page · raw message

tools/include/uapi/asm-generic/unistd.h +30 -99

516 lines not on this page · raw message

Signature · 1 line
2.34.1
maintainer Applied
#4 lore raw

Re: [PATCH] syscalls: Remove file path comments from headers

Quoted 9 lines · Sohil Mehta

Source file locations for syscall definitions can change over a period of time. File paths in comments get stale and are hard to maintain long term. Also, their usefulness is questionable since it would be easier to locate a syscall definition using the SYSCALL_DEFINEx() macro.

Remove all source file path comments from the syscall headers. Also, equalize the uneven line spacing (some of which is introduced due to the deletions).

Quoted 8 lines
---
 include/linux/compat.h                  |  82 ++------------
 include/linux/syscalls.h                | 140 +++---------------------
 include/uapi/asm-generic/unistd.h       | 129 +++++-----------------
 kernel/sys_ni.c                         | 110 +------------------
 tools/include/uapi/asm-generic/unistd.h | 129 +++++-----------------
 5 files changed, 85 insertions(+), 505 deletions(-)

Applied to the asm-generic tree, thanks!

Arnd

#5 lore raw

Re: [PATCH] syscalls: Remove file path comments from headers

Quoted 2 lines · Arnd Bergmann

Applied to the asm-generic tree, thanks!

Great, thanks for the quick response.

While going through the comments, I was wondering if we have a definition of what constitutes a deprecated syscall vs an obsolete one?

For deprecated we have some information saying:

Quoted 4 lines

/*
* Deprecated system calls which are still defined in
* include/uapi/asm-generic/unistd.h and wanted by >= 1 arch */

But, I couldn't find anything for obsolete system calls.

Sohil

maintainer
#6 lore raw

Re: [PATCH] syscalls: Remove file path comments from headers

Quoted 9 lines · Sohil Mehta
Quoted 2 lines · Arnd Bergmann

Applied to the asm-generic tree, thanks!

Great, thanks for the quick response.

While going through the comments, I was wondering if we have a definition of what constitutes a deprecated syscall vs an obsolete one?

Quoted 7 lines

For deprecated we have some information saying:

Quoted 4 lines

/*
* Deprecated system calls which are still defined in
* include/uapi/asm-generic/unistd.h and wanted by >= 1 arch */

But, I couldn't find anything for obsolete system calls.

I don't think we've ever defined the two terms properly, I would assume they are used interchangeably here. If we wanted a definition, 'obsolete' could mean syscalls that are no longer used by current software while 'deprecated' are those that are still called by glibc and others on the architectures that provide them but are emulated through modern variants on other architectures. Without any documentation on the topic, or a definite list, other interpretations are equally possible.

Arnd

Reviewed-by on v1 1/1
#7 lore raw

Re: [PATCH] syscalls: Remove file path comments from headers

In reply to Sohil Mehta
Quoted 11 lines · Sohil Mehta

Source file locations for syscall definitions can change over a period of time. File paths in comments get stale and are hard to maintain long term. Also, their usefulness is questionable since it would be easier to locate a syscall definition using the SYSCALL_DEFINEx() macro.

Remove all source file path comments from the syscall headers. Also, equalize the uneven line spacing (some of which is introduced due to the deletions).

---

Looks good to me,