From 1e7013915b589531aec378df4cd51d615d8abb46 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Sat, 15 Apr 2017 09:57:37 -0600 Subject: [PATCH] Add path implementation for e1000d and ahcid --- ahcid/src/scheme.rs | 11 +++++++++++ e1000d/src/device.rs | 10 ++++++++++ 2 files changed, 21 insertions(+) diff --git a/ahcid/src/scheme.rs b/ahcid/src/scheme.rs index 52df564f0a..f36ad7bb02 100644 --- a/ahcid/src/scheme.rs +++ b/ahcid/src/scheme.rs @@ -98,6 +98,17 @@ impl Scheme for DiskScheme { } } + fn fpath(&self, _id: usize, buf: &mut [u8]) -> Result { + //TODO: Get path + let mut i = 0; + let scheme_path = b"disk:"; + while i < buf.len() && i < scheme_path.len() { + buf[i] = scheme_path[i]; + i += 1; + } + Ok(i) + } + fn read(&self, id: usize, buf: &mut [u8]) -> Result { let mut handles = self.handles.lock(); match *handles.get_mut(&id).ok_or(Error::new(EBADF))? { diff --git a/e1000d/src/device.rs b/e1000d/src/device.rs index bfa6d51408..280c2d3197 100644 --- a/e1000d/src/device.rs +++ b/e1000d/src/device.rs @@ -194,6 +194,16 @@ impl Scheme for Intel8254x { Ok(0) } + fn fpath(&self, _id: usize, buf: &mut [u8]) -> Result { + let mut i = 0; + let scheme_path = b"network:"; + while i < buf.len() && i < scheme_path.len() { + buf[i] = scheme_path[i]; + i += 1; + } + Ok(i) + } + fn fsync(&self, _id: usize) -> Result { Ok(0) }