aboutsummaryrefslogtreecommitdiffstats
path: root/fs/aio.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2018-07-13 06:52:28 -0400
committerArnd Bergmann <arnd@arndb.de>2018-08-27 08:48:48 -0400
commit9afc5eee65ca7d717a99d6fe8f4adfe32a40940a (patch)
tree4e5585234e71076c0a5a470b157e0b9de96b8da6 /fs/aio.c
parent33e26418193f58d1895f2f968e1953b1caf8deb7 (diff)
y2038: globally rename compat_time to old_time32
Christoph Hellwig suggested a slightly different path for handling backwards compatibility with the 32-bit time_t based system calls: Rather than simply reusing the compat_sys_* entry points on 32-bit architectures unchanged, we get rid of those entry points and the compat_time types by renaming them to something that makes more sense on 32-bit architectures (which don't have a compat mode otherwise), and then share the entry points under the new name with the 64-bit architectures that use them for implementing the compatibility. The following types and interfaces are renamed here, and moved from linux/compat_time.h to linux/time32.h: old new --- --- compat_time_t old_time32_t struct compat_timeval struct old_timeval32 struct compat_timespec struct old_timespec32 struct compat_itimerspec struct old_itimerspec32 ns_to_compat_timeval() ns_to_old_timeval32() get_compat_itimerspec64() get_old_itimerspec32() put_compat_itimerspec64() put_old_itimerspec32() compat_get_timespec64() get_old_timespec32() compat_put_timespec64() put_old_timespec32() As we already have aliases in place, this patch addresses only the instances that are relevant to the system call interface in particular, not those that occur in device drivers and other modules. Those will get handled separately, while providing the 64-bit version of the respective interfaces. I'm not renaming the timex, rusage and itimerval structures, as we are still debating what the new interface will look like, and whether we will need a replacement at all. This also doesn't change the names of the syscall entry points, which can be done more easily when we actually switch over the 32-bit architectures to use them, at that point we need to change COMPAT_SYSCALL_DEFINEx to SYSCALL_DEFINEx with a new name, e.g. with a _time32 suffix. Suggested-by: Christoph Hellwig <hch@infradead.org> Link: https://lore.kernel.org/lkml/20180705222110.GA5698@infradead.org/ Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'fs/aio.c')
-rw-r--r--fs/aio.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/aio.c b/fs/aio.c
index b9350f3360c6..301e6314183b 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -2135,12 +2135,12 @@ COMPAT_SYSCALL_DEFINE5(io_getevents, compat_aio_context_t, ctx_id,
2135 compat_long_t, min_nr, 2135 compat_long_t, min_nr,
2136 compat_long_t, nr, 2136 compat_long_t, nr,
2137 struct io_event __user *, events, 2137 struct io_event __user *, events,
2138 struct compat_timespec __user *, timeout) 2138 struct old_timespec32 __user *, timeout)
2139{ 2139{
2140 struct timespec64 t; 2140 struct timespec64 t;
2141 int ret; 2141 int ret;
2142 2142
2143 if (timeout && compat_get_timespec64(&t, timeout)) 2143 if (timeout && get_old_timespec32(&t, timeout))
2144 return -EFAULT; 2144 return -EFAULT;
2145 2145
2146 ret = do_io_getevents(ctx_id, min_nr, nr, events, timeout ? &t : NULL); 2146 ret = do_io_getevents(ctx_id, min_nr, nr, events, timeout ? &t : NULL);
@@ -2160,7 +2160,7 @@ COMPAT_SYSCALL_DEFINE6(io_pgetevents,
2160 compat_long_t, min_nr, 2160 compat_long_t, min_nr,
2161 compat_long_t, nr, 2161 compat_long_t, nr,
2162 struct io_event __user *, events, 2162 struct io_event __user *, events,
2163 struct compat_timespec __user *, timeout, 2163 struct old_timespec32 __user *, timeout,
2164 const struct __compat_aio_sigset __user *, usig) 2164 const struct __compat_aio_sigset __user *, usig)
2165{ 2165{
2166 struct __compat_aio_sigset ksig = { NULL, }; 2166 struct __compat_aio_sigset ksig = { NULL, };
@@ -2168,7 +2168,7 @@ COMPAT_SYSCALL_DEFINE6(io_pgetevents,
2168 struct timespec64 t; 2168 struct timespec64 t;
2169 int ret; 2169 int ret;
2170 2170
2171 if (timeout && compat_get_timespec64(&t, timeout)) 2171 if (timeout && get_old_timespec32(&t, timeout))
2172 return -EFAULT; 2172 return -EFAULT;
2173 2173
2174 if (usig && copy_from_user(&ksig, usig, sizeof(ksig))) 2174 if (usig && copy_from_user(&ksig, usig, sizeof(ksig)))