Commit e4005d05 authored by Jeremy Soller's avatar Jeremy Soller

Add dup to ahci disk scheme

parent 71990b7c
......@@ -43,6 +43,15 @@ impl Scheme for DiskScheme {
}
}
fn dup(&self, id: usize) -> Result<usize> {
let mut handles = self.handles.lock();
let mut handle = handles.get_mut(&id).ok_or(Error::new(EBADF))?;
let new_id = self.next_id.fetch_add(1, Ordering::SeqCst);
self.handles.lock().insert(new_id, handle.clone());
Ok(new_id)
}
fn read(&self, id: usize, buf: &mut [u8]) -> Result<usize> {
let mut handles = self.handles.lock();
let mut handle = handles.get_mut(&id).ok_or(Error::new(EBADF))?;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment