Lines Matching refs:disk
139 .map(|disk| { in from_file()
141 disk.get_read_write_capability() == cdisk_spec::ReadWriteCapability::READ_WRITE, in from_file()
144 .open(disk.get_file_path()) in from_file()
145 .map_err(|e| Error::OpenFile(e, disk.get_file_path().to_string()))?; in from_file()
148 offset: disk.get_offset(), in from_file()
160 if let Some(disk) = disks.get_mut(i) { in from_file()
161 disk.length = length; in from_file()
190 if let Some(disk) = self.component_disks.last() { in length()
191 disk.offset + disk.length in length()
200 .find(|disk| disk.range().contains(&offset)) in disk_at_offset()
210 .filter(|disk| ranges_overlap(&disk.range(), range)) in disks_in_range()
229 for disk in self.component_disks.iter_mut() { in fsync()
230 disk.file.fsync()?; in fsync()
248 let disk = self.disk_at_offset(cursor_location)?; in read_at_volatile() localVariable
249 let subslice = if cursor_location + slice.size() as u64 > disk.offset + disk.length { in read_at_volatile()
250 let new_size = disk.offset + disk.length - cursor_location; in read_at_volatile()
257 disk.file in read_at_volatile()
258 .read_at_volatile(subslice, cursor_location - disk.offset) in read_at_volatile()
262 let disk = self.disk_at_offset(cursor_location)?; in write_at_volatile() localVariable
263 let subslice = if cursor_location + slice.size() as u64 > disk.offset + disk.length { in write_at_volatile()
264 let new_size = disk.offset + disk.length - cursor_location; in write_at_volatile()
271 disk.file in write_at_volatile()
272 .write_at_volatile(subslice, cursor_location - disk.offset) in write_at_volatile()
280 for disk in disks { in punch_hole()
281 let intersection = range_intersection(&range, &disk.range()); in punch_hole()
285 let result = disk.file.punch_hole( in punch_hole()
286 intersection.start - disk.offset, in punch_hole()
301 for disk in disks { in allocate()
302 let intersection = range_intersection(&range, &disk.range()); in allocate()
306 let result = disk.file.allocate( in allocate()
307 intersection.start - disk.offset, in allocate()
321 let disk = self.disk_at_offset(cursor_location)?; in write_zeroes_at() localVariable
322 let offset_within_disk = cursor_location - disk.offset; in write_zeroes_at()
323 let new_length = if cursor_location + length as u64 > disk.offset + disk.length { in write_zeroes_at()
324 (disk.offset + disk.length - cursor_location) as usize in write_zeroes_at()
328 disk.file.write_zeroes_at(offset_within_disk, new_length) in write_zeroes_at()