Skip to content
Zeyuan Hu edited this page Sep 17, 2018 · 3 revisions

Block-level Layer Design

File-system Design

Implementation Decisions

Rust Bindings

We want to create a safe interface for underlying C library functions. However, how we want to do it is still unclear at the current stage. Various prior attempts on working with SPDK using Rust (here and here pursue the route of wrapping each SPDK functions with a Rust layer, which is somewhat similar to git2-rs, a official rust wrapper on git library. As one can see, purusing this route takes a lot of work. Overall, we want to have a Rust block layer API that the upper-level filesystem written in Rust can work with. Thus, how we want to implement the block layer API is totally opaque to the upper-level applications. Therefore, we decide to implement those APIs using native Rust-C bindings generated from bindgen. In other words, we provide a safe interface on block-level API not SPDK library level. For example:

// block-level API for writing a block to underlying NVMe SSD
fn write() {
  unsafe {
   // calling native Rust-C SPDK bindings like program in "hello_nvme_bdev_rust"
  }
}