buf

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2024 License: MIT Imports: 5 Imported by: 4

Documentation

Overview

buf manages sub-block disk objects, to be packed into disk blocks

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Buf

type Buf struct {
	Addr addr.Addr
	Sz   uint64 // number of bits
	Data []byte
	// contains filtered or unexported fields
}

A Buf is a write to a disk object (inode, a bitmap bit, or disk block)

func MkBuf

func MkBuf(addr addr.Addr, sz uint64, data []byte) *Buf

func MkBufLoad

func MkBufLoad(addr addr.Addr, sz uint64, blk disk.Block) *Buf

Load the bits of a disk block into a new buf, as specified by addr

func (*Buf) BnumGet

func (buf *Buf) BnumGet(off uint64) common.Bnum

func (*Buf) BnumPut

func (buf *Buf) BnumPut(off uint64, v common.Bnum)

func (*Buf) Install

func (buf *Buf) Install(blk disk.Block)

Install the bits from buf into blk. Two cases: a bit or an inode

func (*Buf) IsDirty

func (buf *Buf) IsDirty() bool

func (*Buf) SetDirty

func (buf *Buf) SetDirty()

func (*Buf) WriteDirect

func (buf *Buf) WriteDirect(d disk.Disk)

type BufMap

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

func MkBufMap

func MkBufMap() *BufMap

func (*BufMap) Del

func (bmap *BufMap) Del(addr addr.Addr)

func (*BufMap) DirtyBufs

func (bmap *BufMap) DirtyBufs() []*Buf

func (*BufMap) Insert

func (bmap *BufMap) Insert(buf *Buf)

func (*BufMap) Lookup

func (bmap *BufMap) Lookup(addr addr.Addr) *Buf

func (*BufMap) Ndirty

func (bmap *BufMap) Ndirty() uint64

Jump to

Keyboard shortcuts

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