page

package
v0.0.0-...-b142f4f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const PageSize = 1 << 20
View Source
const PoolSize = 64 << 20

Variables

This section is empty.

Functions

This section is empty.

Types

type MemAttr

type MemAttr struct {
	// contains filtered or unexported fields
}

func NewMemAttr

func NewMemAttr(ctx context.Context, pool *Pool, inode metadata.Ino) (*MemAttr, error)

func (*MemAttr) CopyFromAttr

func (memAttr *MemAttr) CopyFromAttr(src *metadata.Attr)

func (*MemAttr) CopyToAttr

func (memAttr *MemAttr) CopyToAttr(dst *metadata.Attr)

func (*MemAttr) Length

func (memAttr *MemAttr) Length() uint64

func (*MemAttr) Setattr

func (memAttr *MemAttr) Setattr(ctx context.Context, in *fuse.SetAttrIn, out *fuse.AttrOut) syscall.Errno

func (*MemAttr) UpdateLength

func (memAttr *MemAttr) UpdateLength(lens uint64)

func (*MemAttr) UpdateLengthIfMore

func (memAttr *MemAttr) UpdateLengthIfMore(lens uint64)

type Page

type Page struct {
	// contains filtered or unexported fields
}

func NewPage

func NewPage(pageNumber int64) *Page

func NewPageWithReader

func NewPageWithReader(pageNumber int64, reader io.Reader, totalSize int64) (*Page, error)

func (*Page) Fsync

func (p *Page) Fsync(ctx context.Context, source *datasource.DataSource, inode metadata.Ino) error

func (*Page) Read

func (p *Page) Read(offset int64, data []byte, length int64) int64

func (*Page) Truncate

func (p *Page) Truncate(size int64)

func (*Page) Write

func (p *Page) Write(offset int64, data []byte)

type Pool

type Pool struct {
	*datasource.DataSource
	// contains filtered or unexported fields
}

func NewPagePool

func NewPagePool(ctx context.Context, dataSource *datasource.DataSource, inode metadata.Ino) (*Pool, error)

func (*Pool) Fsync

func (p *Pool) Fsync(ctx context.Context) error

Fsync write all dirty pages to minio, and write the meta of the file

func (*Pool) MemAttr

func (p *Pool) MemAttr() *MemAttr

func (*Pool) Read

func (p *Pool) Read(ctx context.Context, dest []byte, off int64) (fuse.ReadResult, error)

func (*Pool) Setattr

func (p *Pool) Setattr(ctx context.Context, in *fuse.SetAttrIn, out *fuse.AttrOut) syscall.Errno

func (*Pool) TruncateWithLock

func (p *Pool) TruncateWithLock(ctx context.Context, size uint64) error

TruncateWithLock remove/truncate the cache pages which offset larger than size\

func (*Pool) Write

func (p *Pool) Write(ctx context.Context, data []byte, off int64) (uint32, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL