Skip to content

Commit

Permalink
Adds vfc_name
Browse files Browse the repository at this point in the history
  • Loading branch information
ultimaweapon committed Nov 9, 2024
1 parent 4c3e7fe commit ae34788
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
12 changes: 10 additions & 2 deletions kernel-1100/src/mount.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use crate::lock::Mtx;
use crate::Kernel;
use core::ffi::c_char;
use okf::queue::TailQueueEntry;

/// Implementation of [`okf::mount::Mount`] for 11.00.
Expand Down Expand Up @@ -38,6 +39,13 @@ impl okf::mount::Mount<Kernel> for Mount {

/// Implementation of [`okf::mount::Filesystem`] for 11.00.
#[repr(C)]
pub struct Filesystem {}
pub struct Filesystem {
pad1: [u8; 4],
name: [c_char; 16],
}

impl okf::mount::Filesystem for Filesystem {}
impl okf::mount::Filesystem for Filesystem {
fn name(&self) -> *const c_char {
self.name.as_ptr()
}
}
6 changes: 5 additions & 1 deletion src/mount/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use crate::queue::TailQueueEntry;
use crate::Kernel;
use core::ffi::c_char;

/// Represents `mount` structure.
pub trait Mount<K: Kernel>: Sized {
Expand Down Expand Up @@ -29,4 +30,7 @@ pub trait Mount<K: Kernel>: Sized {
}

/// Represents `vfsconf` structure.
pub trait Filesystem: Sized {}
pub trait Filesystem: Sized {
/// Returns `vfc_name`.
fn name(&self) -> *const c_char;
}

0 comments on commit ae34788

Please sign in to comment.