diff options
author | Guo Ren <guoren@linux.alibaba.com> | 2022-04-05 15:13:05 +0800 |
---|---|---|
committer | Palmer Dabbelt <palmer@rivosinc.com> | 2022-04-26 13:36:25 -0700 |
commit | 59c10c52f573faca862cda5ebcdd43831608eb5a (patch) | |
tree | 786a8dd25890ba8b97f07f01011c02d4a869ad08 /mm | |
parent | 01abdfeac81b5f56062d0a78f2cdc805db937a75 (diff) | |
download | linux-stable-59c10c52f573faca862cda5ebcdd43831608eb5a.tar.gz linux-stable-59c10c52f573faca862cda5ebcdd43831608eb5a.tar.bz2 linux-stable-59c10c52f573faca862cda5ebcdd43831608eb5a.zip |
riscv: compat: syscall: Add compat_sys_call_table implementation
Implement compat sys_call_table and some system call functions:
truncate64, ftruncate64, fallocate, pread64, pwrite64,
sync_file_range, readahead, fadvise64_64 which need argument
translation.
Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
Signed-off-by: Guo Ren <guoren@kernel.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/r/20220405071314.3225832-12-guoren@kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/fadvise.c | 11 | ||||
-rw-r--r-- | mm/readahead.c | 7 |
2 files changed, 18 insertions, 0 deletions
diff --git a/mm/fadvise.c b/mm/fadvise.c index 338f16022012..c76ee665355a 100644 --- a/mm/fadvise.c +++ b/mm/fadvise.c @@ -215,4 +215,15 @@ SYSCALL_DEFINE4(fadvise64, int, fd, loff_t, offset, size_t, len, int, advice) } #endif + +#if defined(CONFIG_COMPAT) && defined(__ARCH_WANT_COMPAT_FADVISE64_64) + +COMPAT_SYSCALL_DEFINE6(fadvise64_64, int, fd, compat_arg_u64_dual(offset), + compat_arg_u64_dual(len), int, advice) +{ + return ksys_fadvise64_64(fd, compat_arg_u64_glue(offset), + compat_arg_u64_glue(len), advice); +} + +#endif #endif diff --git a/mm/readahead.c b/mm/readahead.c index 8e3775829513..a9ba3bb19ad0 100644 --- a/mm/readahead.c +++ b/mm/readahead.c @@ -746,6 +746,13 @@ SYSCALL_DEFINE3(readahead, int, fd, loff_t, offset, size_t, count) return ksys_readahead(fd, offset, count); } +#if defined(CONFIG_COMPAT) && defined(__ARCH_WANT_COMPAT_READAHEAD) +COMPAT_SYSCALL_DEFINE4(readahead, int, fd, compat_arg_u64_dual(offset), size_t, count) +{ + return ksys_readahead(fd, compat_arg_u64_glue(offset), count); +} +#endif + /** * readahead_expand - Expand a readahead request * @ractl: The request to be expanded |