Re: [PATCH v2] rust: time: New module for timekeeping functions

From: Alice Ryhl
Date: Sat Jul 15 2023 - 04:14:23 EST


On 7/15/23 03:17, Thomas Gleixner wrote:
On Fri, Jul 14 2023 at 16:55, Asahi Lina wrote:
+ktime_t rust_helper_ktime_get_real(void) {
+ return ktime_get_real();
+}
+EXPORT_SYMBOL_GPL(rust_helper_ktime_get_real);

Colour me confused. But why does this need another export?

This just creates yet another layer of duct tape. If it's unsafe from
the rust perspective then wrapping it into rust_"unsafe_function" does not
make it any better.

Why on earth can't you use the actual C interfaces diretly which are
already exported?

Currently, you can't call inline C functions directly from Rust. So we wrap them in non-inline functions for now.

It's something we definitely want to fix, but it hasn't been fixed yet.

Alice