C# Class VirtualFileSystem.VFSCore

显示文件 Open project: SummerWish/vfs Class Usage Examples

Public Methods

Method Description
AllocateBlock ( Byte fill ) : Block

分配一个新数据块并清空内容

AllocateINode ( UInt32 flags, UInt32 owner ) : INode

分配、初始化一个新的 inode

DeAllocateBlock ( UInt32 blockIndex ) : void

收回一个数据块

DeAllocateINode ( UInt32 inodeIndex ) : void

收回一个 inode

DePreserveBlock ( UInt32 blocksToDePreserve ) : void

减少预留指定数量的数据块

Format ( UInt32 inodeCapacity, UInt16 blockSizeKByte = 4 ) : void

格式化存储介质

GetDevice ( ) : AbstractDevice

获取此文件系统的存储介质操作对象

GetSuperBlock ( ) : SuperBlock

获取此文件系统的超级块操作对象

IsBlockAllocated ( UInt32 index ) : System.Boolean

判断 block inde

IsFormated ( ) : System.Boolean

返回存储介质是否已格式化

IsINodeAllocated ( UInt32 index ) : System.Boolean

判断 inode index 是否已被占用

PreserveBlock ( UInt32 blocksToPreserve ) : void

预留指定数量的数据块

VFSCore ( AbstractDevice device ) : System

Private Methods

Method Description
GetFreeBlockIndex ( ) : UInt32

查找一个空闲块

GetFreeINodeIndex ( ) : UInt32

查找一个空闲 inode

GitBitmapAvailableIndex ( UInt32 bitmap ) : UInt32

获取一个位图可用的位置,若无法找到则返回 Int32.MaxValue

IsBitmapAllocated ( UInt32 bitmap, UInt32 index ) : System.Boolean

位图指定位置是否已被分配

SetBitmapAllocated ( UInt32 offset, UInt32 bitmap, UInt32 index ) : void

位图指定位置标记为已占用

SetBitmapNotAllocated ( UInt32 offset, UInt32 bitmap, UInt32 index ) : void

位图指定位置标记为未被占用

UpdateBitmapVectorAtIndex ( UInt32 offset, UInt32 bitmap, UInt32 index ) : void

持久化一个位图向量

loadBitmaps ( ) : void

从已经格式化的存储介质中载入位图到内存

Method Details

AllocateBlock() public method

分配一个新数据块并清空内容
public AllocateBlock ( Byte fill ) : Block
fill Byte
return Block

AllocateINode() public method

分配、初始化一个新的 inode
public AllocateINode ( UInt32 flags, UInt32 owner ) : INode
flags System.UInt32
owner System.UInt32
return INode

DeAllocateBlock() public method

收回一个数据块
public DeAllocateBlock ( UInt32 blockIndex ) : void
blockIndex System.UInt32
return void

DeAllocateINode() public method

收回一个 inode
public DeAllocateINode ( UInt32 inodeIndex ) : void
inodeIndex System.UInt32
return void

DePreserveBlock() public method

减少预留指定数量的数据块
public DePreserveBlock ( UInt32 blocksToDePreserve ) : void
blocksToDePreserve System.UInt32
return void

Format() public method

格式化存储介质
public Format ( UInt32 inodeCapacity, UInt16 blockSizeKByte = 4 ) : void
inodeCapacity System.UInt32 inode 数量
blockSizeKByte System.UInt16 block 大小(KB),必须为 1,2,4,8 中的一个
return void

GetDevice() public method

获取此文件系统的存储介质操作对象
public GetDevice ( ) : AbstractDevice
return AbstractDevice

GetSuperBlock() public method

获取此文件系统的超级块操作对象
public GetSuperBlock ( ) : SuperBlock
return SuperBlock

IsBlockAllocated() public method

判断 block inde
public IsBlockAllocated ( UInt32 index ) : System.Boolean
index System.UInt32
return System.Boolean

IsFormated() public method

返回存储介质是否已格式化
public IsFormated ( ) : System.Boolean
return System.Boolean

IsINodeAllocated() public method

判断 inode index 是否已被占用
public IsINodeAllocated ( UInt32 index ) : System.Boolean
index System.UInt32
return System.Boolean

PreserveBlock() public method

预留指定数量的数据块
public PreserveBlock ( UInt32 blocksToPreserve ) : void
blocksToPreserve System.UInt32
return void

VFSCore() public method

public VFSCore ( AbstractDevice device ) : System
device AbstractDevice
return System