Linux 6.13 Introducing New Rust File Abstractions

Written by Michael Larabel in Linux Kernel on 16 November 2024 at 06:52 AM EST. 12 Comments
LINUX KERNEL
Alongside the VFS pull requests on Friday for case insensitive Tmpfs support and atomic writes for EXT4 and XFS, Christian Brauner also submitted a pull request for introducing some new file abstractions for the Rust programming language within the Linux kernel.

These Rust file abstractions are needed for the Rust language implementation of Google's Binder driver. These file abstractions will also be useful elsewhere in the Rust kernel code but the initial motivation was to help with the Binder driver porting.

Among these Rust additions are introducing a "NotThreadSafe" type, adding Task::current_raw, a secctx abstraction, a Kuid wrapper, a poll_table abstraction, seqfile abstraction, and Rust abstractions for "struct file" and struct cred" along with a "FileDescriptorReservation".

Brauner commented in this pull request for the imminent Linux 6.13 merge window:
"This contains the file abstractions needed by the Rust implementation of the Binder driver and other parts of the kernel.

Let's treat this as a first attempt at getting something working but I do expect the actual interfaces to change significantly over time. Simply because we are still figuring out what actually works. But there's no point in further theorizing. Let's see how it holds up with actual users."

We'll see what other Rust code also ends up getting submitted for the Linux 6.13 kernel cycle -- another one already on the radar is Rust support for in-place kernel modules.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week