// Discard any extents whose logical offset succeeds |offset|.
Discard any extents whose logical offset succeeds |offset|.
Discard any extents whose logical offset succeeds |offset| .
pub fn discard_extents(&mut self, discard_offset: u64) {
        let mut offset = self.start_offset + self.size;
        let mut num = 0;
        while let Some(extent) = self.extents.last() {
            let length = extent.length().unwrap();
            offset = offset.checked_sub(length).unwrap();
            if offset < discard_offset {
                break;
            }
            self.size -= length;
            self.extents.pop();
            num += 1;
        }
        if self.trace.load(Ordering::Relaxed) {
            log::info!("JH: Discarded {} extents from offset {}", num, discard_offset);
        }
    }
pub fn discard_extents ( & mut self , discard_offset : u64 ) { let mut offset = self . start_offset + self . size ; let mut num = 0 ; while let Some ( extent ) = self . extents . last ( ) { let length = extent . length ( ) . unwrap ( ) ; offset = offset . checked_sub ( length ) . unwrap ( ) ; if offset < discard_offset { break ; } self . size -= length ; self . extents . pop ( ) ; num += 1 ; } if self . trace . load ( Ordering :: Relaxed ) { log :: info ! ( " " num discard_offset ) ; } }
Discard any extents whose logical offset succeeds |offset|.
Discard any extents whose logical offset succeeds |offset| .
&mut self
discard_offset
u64