rust: configfs: introduce rust support for configfs

Add a Rust API for configfs, thus allowing Rust modules to use configfs for
configuration. Make the implementation a shim on top of the C configfs
implementation, allowing safe use of the C infrastructure from Rust.

Link: https://lore.kernel.org/r/20250508-configfs-v8-1-8ebde6180edc@kernel.org
Signed-off-by: Andreas Hindborg <a.hindborg@kernel.org>
This commit is contained in:
Andreas Hindborg 2025-05-08 10:52:09 +02:00
parent bbb67d4f85
commit 446cafc295
4 changed files with 1057 additions and 0 deletions

View File

@ -10,6 +10,7 @@
#include <linux/blk-mq.h>
#include <linux/blk_types.h>
#include <linux/blkdev.h>
#include <linux/configfs.h>
#include <linux/cpumask.h>
#include <linux/cred.h>
#include <linux/device/faux.h>

View File

@ -17,3 +17,8 @@ void rust_helper_mutex_assert_is_held(struct mutex *mutex)
{
lockdep_assert_held(mutex);
}
void rust_helper_mutex_destroy(struct mutex *lock)
{
mutex_destroy(lock);
}

1049
rust/kernel/configfs.rs Normal file

File diff suppressed because it is too large Load Diff

View File

@ -42,6 +42,8 @@ pub mod alloc;
pub mod block;
#[doc(hidden)]
pub mod build_assert;
#[cfg(CONFIG_CONFIGFS_FS)]
pub mod configfs;
pub mod cred;
pub mod device;
pub mod device_id;