pub fn readahead(fd: libc::c_int, mut offset: u64, end: u64) {
    offset = round_down_4k(offset);
    while offset < end {
        // Kernel default 128KB readahead size
        let count = std::cmp::min(128 << 10, end - offset);
        unsafe { libc::readahead(fd, offset as i64, count as usize) };
        offset += count;
    }
}
/// A customized readahead function to ask kernel to fault in all pages from offset to end.
///
/// Call libc::readahead on every 128KB range because otherwise readahead stops at kernel bdi
/// readahead size which is 128KB by default.
A customized readahead function to ask kernel to fault in all pages from offset to end.
Call libc::readahead on every 128KB range because otherwise readahead stops at kernel bdi
readahead size which is 128KB by default.
A customized readahead function to ask kernel to fault in all pages from offset to end . Call libc :: readahead on every 128KB range because otherwise readahead stops at kernel bdi readahead size which is 128KB by default .
pub fn readahead(fd: libc::c_int, mut offset: u64, end: u64) {
    offset = round_down_4k(offset);
    while offset < end {
        // Kernel default 128KB readahead size
        let count = std::cmp::min(128 << 10, end - offset);
        unsafe { libc::readahead(fd, offset as i64, count as usize) };
        offset += count;
    }
}
pub fn readahead ( fd : libc :: c_int , mut offset : u64 , end : u64 ) { offset = round_down_4k ( offset ) ; while offset < end { // Kernel default 128KB readahead size let count = std :: cmp :: min ( 128 << 10 , end - offset ) ; unsafe { libc :: readahead ( fd , offset as i64 , count as usize ) } ; offset += count ; } }
A customized readahead function to ask kernel to fault in all pages from offset to end.
A customized readahead function to ask kernel to fault in all pages from offset to end .
fd
libc::c_int
offset
u64
end
u64
fd
libc::c_int
offset
u64
end
u64