Lines Matching refs:path
32 use std::path::{Path, PathBuf};
77 pub path: PathBuf, field
82 path: P, in attach()
100 match try_attach(&path, offset, size_limit, options) { in attach()
119 path: P, in try_attach()
138 .open(&path) in try_attach()
139 .context(format!("failed to open {:?}", path.as_ref()))?; in try_attach()
169 Ok(LoopDevice { file: device_file, path: PathBuf::from(device_path) }) in try_attach()
173 pub fn detach<P: AsRef<Path>>(path: P) -> Result<()> { in detach()
174 let device_file = OpenOptions::new().read(true).write(true).open(&path)?; in detach()
183 use std::path::Path;
185 fn create_empty_file(path: &Path, size: u64) { in create_empty_file()
186 let f = File::create(path).unwrap(); in create_empty_file()
210 let a_file = a_dir.path().join("test"); in attach_loop_device_with_dio()
216 .path; in attach_loop_device_with_dio()
226 let a_file = a_dir.path().join("test"); in attach_loop_device_without_dio()
229 let dev = attach(a_file, 0, a_size, &LoopConfigOptions::default()).unwrap().path; in attach_loop_device_without_dio()
239 let a_file = a_dir.path().join("test"); in attach_loop_device_with_dio_writable()
249 .path; in attach_loop_device_with_dio_writable()
260 let a_file = a_dir.path().join("test"); in attach_loop_device_autoclear()
267 assert!(is_autoclear(&dev.path)); in attach_loop_device_autoclear()