Documentation ¶
Index ¶
Constants ¶
View Source
const ( BlockBit = 18 BlockSize = 1 << BlockBit )
View Source
const InodePadding = 44
Variables ¶
View Source
var ( MagicEOF = Magic{0x8a, 0x9c, 0x0, 0x1} MagicInode = Magic{0x8a, 0x9c, 0x0, 0x2} )
Functions ¶
Types ¶
type DiskBuffer ¶
type DiskBuffer struct {
// contains filtered or unexported fields
}
func NewDiskBuffer ¶
func NewDiskBuffer(rw io.ReadWriter) *DiskBuffer
func (*DiskBuffer) ReadItem ¶
func (d *DiskBuffer) ReadItem(da Diskable) error
func (*DiskBuffer) WriteItem ¶
func (d *DiskBuffer) WriteItem(da Diskable) error
type DiskReadItem ¶
type DiskReader ¶
type DiskReader struct {
// contains filtered or unexported fields
}
func NewDiskReader ¶
func NewDiskReader(b []byte) *DiskReader
func (*DiskReader) Peek ¶
func (r *DiskReader) Peek(n int) []byte
func (*DiskReader) ReadBytes ¶
func (r *DiskReader) ReadBytes(n int) []byte
func (*DiskReader) ReadItem ¶
func (r *DiskReader) ReadItem(d DiskReadItem) error
func (*DiskReader) ReadItems ¶
func (r *DiskReader) ReadItems(ds []DiskReadItem) error
func (*DiskReader) ReadMagic ¶
func (r *DiskReader) ReadMagic(d Diskable) error
func (*DiskReader) Skip ¶
func (r *DiskReader) Skip(n int)
type DiskWriteItem ¶
type DiskWriter ¶
type DiskWriter struct {
// contains filtered or unexported fields
}
func NewDiskWriter ¶
func NewDiskWriter(b []byte) *DiskWriter
func (*DiskWriter) Skip ¶
func (w *DiskWriter) Skip(n int)
func (*DiskWriter) WriteBytes ¶
func (w *DiskWriter) WriteBytes(b []byte)
func (*DiskWriter) WriteItem ¶
func (w *DiskWriter) WriteItem(d DiskWriteItem)
func (*DiskWriter) WriteMagic ¶
func (w *DiskWriter) WriteMagic(d Diskable)
type Flusher ¶
type Flusher struct {
// contains filtered or unexported fields
}
func (*Flusher) WriteByInode ¶
type Inode ¶
type Inode struct { // Magic 4 Ino Int32 Start Int32 Size Int32 // 8 Prev, Prev2, Prev4, Prev8, Prev16, Prev32, PrevGroup Address // 7*8 GroupSize Int32 GroupIdx Int32 // 8 Offsets [150]ShortAddr // contains filtered or unexported fields }
size: 1kB one inode can store 37.5MB
func (*Inode) GetBlockSize ¶
func (*Inode) GetOffsetIdx ¶
type InodePool ¶
type InodePool struct {
// contains filtered or unexported fields
}
Pool for one file
func NewInodePool ¶
func NewInodePool(ino int32, delegate InodePoolDelegate) *InodePool
func (*InodePool) GetLastest ¶
get newest inode from memory or disk
type InodePoolDelegate ¶
type InodeScatter ¶
type InodeScatter [32]*Inode
func (*InodeScatter) Current ¶
func (s *InodeScatter) Current() *Inode
func (*InodeScatter) Push ¶
func (is *InodeScatter) Push(i *Inode)
Click to show internal directories.
Click to hide internal directories.