diff options
author | Mark Rutland <mark.rutland@arm.com> | 2018-07-11 09:56:51 -0400 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2018-07-12 09:49:48 -0400 |
commit | 9b54bf9d6a5b30e2cc22b18793e9a4158c5b4882 (patch) | |
tree | 2239cebf690d0e02e630567eec999229d27e74cf /include/linux/compat.h | |
parent | bf1c77b4644f46d2986b7ca5e43e012f0fc8984b (diff) |
kernel: add kcompat_sys_{f,}statfs64()
Using this helper allows us to avoid the in-kernel calls to the
compat_sys_{f,}statfs64() sycalls, as are necessary for parameter
mangling in arm64's compat handling.
Following the example of ksys_* functions, kcompat_sys_* functions are
intended to be a drop-in replacement for their compat_sys_*
counterparts, with the same calling convention.
This is necessary to enable conversion of arm64's syscall handling to
use pt_regs wrappers.
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Dominik Brodowski <linux@dominikbrodowski.net>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'include/linux/compat.h')
-rw-r--r-- | include/linux/compat.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/compat.h b/include/linux/compat.h index c68acc47da57..43f4ed44c5d5 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
@@ -1028,6 +1028,17 @@ static inline struct compat_timeval ns_to_compat_timeval(s64 nsec) | |||
1028 | return ctv; | 1028 | return ctv; |
1029 | } | 1029 | } |
1030 | 1030 | ||
1031 | /* | ||
1032 | * Kernel code should not call compat syscalls (i.e., compat_sys_xyzyyz()) | ||
1033 | * directly. Instead, use one of the functions which work equivalently, such | ||
1034 | * as the kcompat_sys_xyzyyz() functions prototyped below. | ||
1035 | */ | ||
1036 | |||
1037 | int kcompat_sys_statfs64(const char __user * pathname, compat_size_t sz, | ||
1038 | struct compat_statfs64 __user * buf); | ||
1039 | int kcompat_sys_fstatfs64(unsigned int fd, compat_size_t sz, | ||
1040 | struct compat_statfs64 __user * buf); | ||
1041 | |||
1031 | #else /* !CONFIG_COMPAT */ | 1042 | #else /* !CONFIG_COMPAT */ |
1032 | 1043 | ||
1033 | #define is_compat_task() (0) | 1044 | #define is_compat_task() (0) |