Lines Matching refs:path
150 pub fn lookup_gendisk_by_path(&self, path: &str) -> Option<Arc<GenDisk>> { in lookup_gendisk_by_path()
151 let (devname, partno) = self.path2devname(path)?; in lookup_gendisk_by_path()
183 fn path2devname<'a>(&self, mut path: &'a str) -> Option<(&'a str, u32)> { in path2devname()
185 if path.starts_with("/dev/") { in path2devname()
186 path = path.strip_prefix("/dev/")?; in path2devname()
191 let mut last_digit = path.len(); in path2devname()
192 while last_digit > 0 && path.chars().nth(last_digit - 1).unwrap().is_ascii_digit() { in path2devname()
196 return (path, GenDisk::ENTIRE_DISK_IDX).into(); in path2devname()
199 if last_digit < path.len() { in path2devname()
200 partno = path[last_digit..].parse().ok()?; in path2devname()
203 let path = &path[..last_digit]; in path2devname() localVariable
205 Some((path, partno)) in path2devname()