Documentation
¶
Index ¶
- Constants
- Variables
- type Allocator
- type BitmapAllocator
- type Driver
- func (s *Driver) Append(fd *DriverFile, pl []byte) (err error)
- func (s *Driver) Destroy()
- func (s *Driver) EncodeLogName(name string) string
- func (s *Driver) Free(fd *DriverFile)
- func (s *Driver) GetInodeSize() uint32
- func (s *Driver) GetName() string
- func (s *Driver) GetNodes() map[string]*DriverFile
- func (s *Driver) GetPageSize() uint32
- func (s *Driver) Init(name string) (err error)
- func (s *Driver) Mount()
- func (s *Driver) NewBlockFile(fname string) *DriverFile
- func (s *Driver) Open(name string) (err error)
- func (s *Driver) PrintLog(name, info string)
- func (s *Driver) ReleaseFile(fd *DriverFile)
- func (s *Driver) Replay(cache *bytes.Buffer) error
- func (s *Driver) Sync() error
- func (s *Driver) Unmount()
- func (s *Driver) Update(fd *DriverFile, pl []byte, fOffset uint64) error
- type DriverFile
- func (b *DriverFile) Append(offset uint64, data []byte, originSize uint32) (err error)
- func (b *DriverFile) Destroy()
- func (b *DriverFile) GetExtents() *[]Extent
- func (b *DriverFile) GetInode() *Inode
- func (b *DriverFile) GetName() string
- func (b *DriverFile) GetSegement() *Driver
- func (b *DriverFile) Read(data []byte) (n int, err error)
- func (b *DriverFile) ReadExtent(offset, length uint32, data []byte) (uint32, error)
- func (b *DriverFile) SetCols(cols uint32)
- func (b *DriverFile) SetIdxs(idxs uint32)
- func (b *DriverFile) SetRows(rows uint32)
- func (b *DriverFile) Update(offset uint64, data []byte, fOffset uint32) ([]Extent, error)
- type Extent
- type ExtentType
- type Inode
- type Log
- type StateType
- type SuperBlock
Constants ¶
View Source
const ALL_UNIT_CLEAR = 0
View Source
const ALL_UNIT_SET = 0xffffffffffffffff
View Source
const BITS_PER_UNIT = UNIT_BYTES * 8
View Source
const BITS_PER_UNITSET = UNITSET_BYTES * 8
View Source
const BLOCK_SIZE = 4096
View Source
const BLOCK_SUFFIX = "blk"
View Source
const DATA_SIZE = SIZE - DATA_START
View Source
const DATA_START = 0
View Source
const DELETE_SUFFIX = "del"
View Source
const HOLE_SIZE = 512 * INODE_SIZE
View Source
const INDEX_SUFFIX = "idx"
View Source
const INODE_NUM = 20480
View Source
const INODE_SIZE = 512
View Source
const LOG_SIZE = INODE_NUM * INODE_SIZE
View Source
const LOG_START = 2 * BLOCK_SIZE
View Source
const MAGIC = 0xFFFFFFFF
View Source
const SIZE = 2 * 1024 * 1024 * 1024
View Source
const UNITSET_BYTES = UNIT_BYTES * UNITS_PER_UNITSET
View Source
const UNITS_PER_UNITSET = 8
View Source
const UNIT_BYTES = 8 // Length of uint64 bytes
View Source
const UPDATE_SUFFIX = "update"
View Source
const UPGRADE_FILE_NUM = 2
Variables ¶
View Source
var ErrInodeLimit = errors.New("tae driver: Too many inodes")
View Source
var ErrNoSpace = errors.New("tae driver: No space")
View Source
var SegmentFactory file.SegmentFactory
Functions ¶
This section is empty.
Types ¶
type Allocator ¶
type Allocator interface {
Allocate(len uint64) (uint64, uint64)
Free(start uint32, len uint32)
CheckAllocations(start uint32, len uint32)
}
func NewBitmapAllocator ¶
type BitmapAllocator ¶
type BitmapAllocator struct {
// contains filtered or unexported fields
}
func (*BitmapAllocator) Allocate ¶
func (b *BitmapAllocator) Allocate(needLen uint64) (uint64, uint64)
func (*BitmapAllocator) CheckAllocations ¶
func (b *BitmapAllocator) CheckAllocations(start uint32, len uint32)
func (*BitmapAllocator) Free ¶
func (b *BitmapAllocator) Free(start uint32, len uint32)
func (*BitmapAllocator) Init ¶
func (b *BitmapAllocator) Init(capacity uint64, pageSize uint32)
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
func (*Driver) EncodeLogName ¶
func (*Driver) Free ¶
func (s *Driver) Free(fd *DriverFile)
func (*Driver) GetInodeSize ¶
func (*Driver) GetNodes ¶
func (s *Driver) GetNodes() map[string]*DriverFile
func (*Driver) GetPageSize ¶
func (*Driver) NewBlockFile ¶
func (s *Driver) NewBlockFile(fname string) *DriverFile
func (*Driver) ReleaseFile ¶
func (s *Driver) ReleaseFile(fd *DriverFile)
type DriverFile ¶
func (*DriverFile) Append ¶
func (b *DriverFile) Append(offset uint64, data []byte, originSize uint32) (err error)
func (*DriverFile) Destroy ¶
func (b *DriverFile) Destroy()
func (*DriverFile) GetExtents ¶
func (b *DriverFile) GetExtents() *[]Extent
func (*DriverFile) GetInode ¶
func (b *DriverFile) GetInode() *Inode
func (*DriverFile) GetName ¶
func (b *DriverFile) GetName() string
func (*DriverFile) GetSegement ¶
func (b *DriverFile) GetSegement() *Driver
func (*DriverFile) ReadExtent ¶
func (b *DriverFile) ReadExtent(offset, length uint32, data []byte) (uint32, error)
func (*DriverFile) SetCols ¶
func (b *DriverFile) SetCols(cols uint32)
func (*DriverFile) SetIdxs ¶
func (b *DriverFile) SetIdxs(idxs uint32)
func (*DriverFile) SetRows ¶
func (b *DriverFile) SetRows(rows uint32)
type Inode ¶
type Inode struct {
// contains filtered or unexported fields
}
func (*Inode) GetFileSize ¶
func (*Inode) GetOriginSize ¶
type Log ¶
type Log struct {
// contains filtered or unexported fields
}
func (*Log) Append ¶
func (l *Log) Append(file *DriverFile) error
func (*Log) RemoveInode ¶
func (l *Log) RemoveInode(file *DriverFile) error
type SuperBlock ¶
type SuperBlock struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.