rsext4 0.4.1

A lightweight ext4 file system.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! Bitmap allocation error mapping helpers.

use crate::{
    bitmap::BitmapError,
    error::{Errno, Ext4Error},
};

pub(crate) fn map_bitmap_error(err: BitmapError) -> Ext4Error {
    match err {
        BitmapError::IndexOutOfRange => Ext4Error::invalid_input(),
        BitmapError::AlreadyAllocated => Ext4Error::already_exists(),
        BitmapError::AlreadyFree => Ext4Error::from(Errno::ENOENT),
    }
}