/// Add a new bio covering the IO range into the provided bio desc.
///
/// Returns true if caller should continue checking more chunks.
///
/// # Parameters
/// - desc: the targeting bio desc.
/// - offset: IO offset to the file start, inclusive.
/// - end: IO end to the file start, exclusive.
/// - chunk: a data chunk overlapping with the IO range.
/// - chunk_size: chunk size.
/// - blob: the blob which the chunk data belongs to.
Add a new bio covering the IO range into the provided bio desc.
Returns true if caller should continue checking more chunks.

Parameters
desc: the targeting bio desc.
offset: IO offset to the file start, inclusive.
end: IO end to the file start, exclusive.
chunk: a data chunk overlapping with the IO range.
Add a new bio covering the IO range into the provided bio desc . Returns true if caller should continue checking more chunks . Parameters desc : the targeting bio desc . offset : IO offset to the file start inclusive . end : IO end to the file start exclusive . chunk : a data chunk overlapping with the IO range .
fn add_chunk_to_bio_desc(
    desc: &mut BlobIoVec,
    offset: u64,
    end: u64,
    chunk: Arc<dyn BlobV5ChunkInfo>,
    blob: Arc<BlobInfo>,
    user_io: bool,
) -> bool {
    // The chunk is ahead of the start of the range.
    if offset >= (chunk.file_offset() + chunk.uncompress_size() as u64) {
        return true;
    }
    // The chunk is passing the end of the range.
    if end <= chunk.file_offset() {
        return false;
    }
    let chunk_start = if offset > chunk.file_offset() {
        offset - chunk.file_offset()
    } else {
        0
    };
    let chunk_end = if end < (chunk.file_offset() + chunk.uncompress_size() as u64) {
        end - chunk.file_offset()
    } else {
        chunk.uncompress_size() as u64
    };
    let bio = BlobIoDesc::new(
        blob,
        chunk.into(),
        chunk_start as u32,
        (chunk_end - chunk_start) as usize,
        user_io,
    );
    desc.bi_size += bio.size;
    desc.bi_vec.push(bio);
    true
}
fn add_chunk_to_bio_desc ( desc : & mut BlobIoVec , offset : u64 , end : u64 , chunk : Arc < dyn BlobV5ChunkInfo > , blob : Arc < BlobInfo > , user_io : bool , ) -> bool { // The chunk is ahead of the start of the range. if offset >= ( chunk . file_offset ( ) + chunk . uncompress_size ( ) as u64 ) { return true ; } // The chunk is passing the end of the range. if end <= chunk . file_offset ( ) { return false ; } let chunk_start = if offset > chunk . file_offset ( ) { offset - chunk . file_offset ( ) } else { 0 } ; let chunk_end = if end < ( chunk . file_offset ( ) + chunk . uncompress_size ( ) as u64 ) { end - chunk . file_offset ( ) } else { chunk . uncompress_size ( ) as u64 } ; let bio = BlobIoDesc :: new ( blob , chunk . into ( ) , chunk_start as u32 , ( chunk_end - chunk_start ) as usize , user_io , ) ; desc . bi_size += bio . size ; desc . bi_vec . push ( bio ) ; true }
Add a new bio covering the IO range into the provided bio desc.
Add a new bio covering the IO range into the provided bio desc .
desc
&mut BlobIoVec
offset
u64
end
u64
chunk
Arc<dyn BlobV5ChunkInfo>
blob
Arc<BlobInfo>
user_io
bool