[PATCH 0/7] Binary Large Objects for Rust DebugFS

Danilo Krummrich posted 7 patches 4 months ago
There is a newer version of this series
rust/kernel/debugfs.rs              | 112 ++++++++++++++++-
rust/kernel/debugfs/file_ops.rs     | 144 ++++++++++++++++++++-
rust/kernel/debugfs/traits.rs       | 186 +++++++++++++++++++++++++++-
rust/kernel/uaccess.rs              |  29 +++++
samples/rust/rust_debugfs.rs        |  13 ++
samples/rust/rust_debugfs_scoped.rs |  14 ++-
6 files changed, 487 insertions(+), 11 deletions(-)
[PATCH 0/7] Binary Large Objects for Rust DebugFS
Posted by Danilo Krummrich 4 months ago
This series adds support for exposing binary large objects via Rust debugfs.

The first two patches extend UserSliceReader and UserSliceWriter with partial
read/write helpers.

The series further introduces read_binary_file(), write_binary_file() and
read_write_binary_file() methods for the Dir and ScopedDir types.

It also introduces the BinaryWriter and BinaryReader traits, which are used to
read/write the implementing type's binary representation with the help of the
backing file operations from/to debugfs.

Additional to some more generic blanked implementations for the BinaryWriter and
BinaryReader traits it also provides implementations for common smart pointer
types.

Both samples (file-based and scoped) are updated with corresponding examples.

A branch containing the patches can be found in [1].

[1] https://git.kernel.org/pub/scm/linux/kernel/git/dakr/linux.git/log/?h=debugfs_blobs

Danilo Krummrich (7):
  rust: uaccess: add UserSliceReader::read_slice_partial()
  rust: uaccess: add UserSliceWriter::write_slice_partial()
  rust: debugfs: support for binary large objects
  rust: debugfs: support blobs from smart pointers
  samples: rust: debugfs: add example for blobs
  rust: debugfs: support binary large objects for ScopedDir
  samples: rust: debugfs_scoped: add example for blobs

 rust/kernel/debugfs.rs              | 112 ++++++++++++++++-
 rust/kernel/debugfs/file_ops.rs     | 144 ++++++++++++++++++++-
 rust/kernel/debugfs/traits.rs       | 186 +++++++++++++++++++++++++++-
 rust/kernel/uaccess.rs              |  29 +++++
 samples/rust/rust_debugfs.rs        |  13 ++
 samples/rust/rust_debugfs_scoped.rs |  14 ++-
 6 files changed, 487 insertions(+), 11 deletions(-)


base-commit: e406d57be7bd2a4e73ea512c1ae36a40a44e499e
-- 
2.51.0