fn filename_to_inode(parent_inode: u64, name: &OsStr) -> Option<u64> {
    let name = name.to_str()?;

    match parent_inode {
        1 => {
            // root directory
            match name {
                ".plentyfs" => Some(2),
        s => s
            .parse::<u64>()
            .ok()
            // Filenames start at 0, but inodes for these files start at 101.
            .and_then(|file_number| Some(file_number + 101)),
            }
        },
        2 => {
            // .plentyfs
            match name {
                "seed" => Some(3),
                _ => None,
            }
        },
        _ => None,
    }
}
/// Convert filename into an inode number. Note that the inode might not actually exist.
///
/// Returns `None` if conversion couldn't be performed (most probably because the filename is
/// malformed).
Convert filename into an inode number. Note that the inode might not actually exist.
Returns `None` if conversion couldn't be performed (most probably because the filename is
malformed).
Convert filename into an inode number . Note that the inode might not actually exist . Returns ` None ` if conversion couldn ' t be performed ( most probably because the filename is malformed ) .
fn filename_to_inode(parent_inode: u64, name: &OsStr) -> Option<u64> {
    let name = name.to_str()?;
    match parent_inode {
        1 => {
            // root directory
            match name {
                ".plentyfs" => Some(2),
        s => s
            .parse::<u64>()
            .ok()
            // Filenames start at 0, but inodes for these files start at 101.
            .and_then(|file_number| Some(file_number + 101)),
            }
        },
        2 => {
            // .plentyfs
            match name {
                "seed" => Some(3),
                _ => None,
            }
        },
        _ => None,
    }
}
fn filename_to_inode ( parent_inode : u64 , name : & OsStr ) -> Option < u64 > { let name = name . to_str ( ) ? ; match parent_inode { 1 => { // root directory match name { " " => Some ( 2 ) , s => s . parse :: < u64 > ( ) . ok ( ) // Filenames start at 0, but inodes for these files start at 101. . and_then ( | file_number | Some ( file_number + 101 ) ) , } } , 2 => { // .plentyfs match name { " " => Some ( 3 ) , _ => None , } } , _ => None , } }
Convert filename into an inode number.
Convert filename into an inode number .
parent_inode
u64
name
&OsStr
parent_inode
u64
name
&OsStr