Get information about the loop device.
(&self)
| 41 | |
| 42 | /// Get information about the loop device. |
| 43 | pub fn get_info(&self) -> AxResult<loop_info> { |
| 44 | if self.file.lock().is_none() { |
| 45 | return Err(AxError::from(LinuxError::ENXIO)); |
| 46 | } |
| 47 | let mut res: loop_info = unsafe { core::mem::zeroed() }; |
| 48 | res.lo_number = self.number as _; |
| 49 | res.lo_rdevice = self.dev_id.0 as _; |
| 50 | Ok(res) |
| 51 | } |
| 52 | |
| 53 | /// Set information for the loop device. |
| 54 | pub fn set_info(&self, _src: loop_info) -> AxResult<()> { |