~/bend-docscommunity

host/fs.bend relies on unsafe/foreign

raw source on the hub · import 0xec4070cc970212faf4003d589ad8e6c1/host/fs.bend as Fs

9 imports
import Base
import ../src/lib/u64.bend as U
import ../src/vmm/abi.bend as V
import ./hvf.bend as H
import ../src/fs/quota.bend as Qt
import ../src/fs/contain.bend as Ct
import ../src/fs/listing.bend as Ls
import ../src/fs/entry.bend as En
import ../src/host/fdcache.bend as Fc

Definitions

def Fs.w source · line 13 · raw

@+ws:List<&2, U32> -> @i:Nat -> U32

def Fs.w64 source · line 16 · raw

@+ws:List<&2, U32> -> @i:Nat -> 0xec4070cc970212faf4003d589ad8e6c1/src/lib/u64.U64

def Fs.chars source · line 20 · raw

@bs:List<&2, U32> -> String

def Fs.entries source · line 28 · raw

@fuel:Nat -> @ws:List<&2, U32> -> List<&2, 0xec4070cc970212faf4003d589ad8e6c1/src/vmm/abi.FsEntry>

Entries: (ino hi, ino lo, type, name length, name bytes)*.

def Fs.attr source · line 42 · raw

@+ws:List<&2, U32> -> 0xec4070cc970212faf4003d589ad8e6c1/src/vmm/abi.FsAttr

def Fs.ename source · line 45 · raw

@e:0xec4070cc970212faf4003d589ad8e6c1/src/vmm/abi.FsEntry -> String

def Fs.decode.go source · line 50 · raw

@+tag:U32 -> @+ws:List<&2, U32> -> 0xec4070cc970212faf4003d589ad8e6c1/src/vmm/abi.FsResult

def Fs.tag source · line 62 · raw

@+t:U32 -> U32

(tags 8 and 9 are 3 and 4 when the host opened a file for the operation)

def Fs.decode source · line 65 · raw

@+ws:List<&2, U32> -> 0xec4070cc970212faf4003d589ad8e6c1/src/vmm/abi.FsResult

def Fs.placed source · line 70 · raw

@opened:Bool -> @+ws:List<&2, U32> -> IO(0xec4070cc970212faf4003d589ad8e6c1/src/vmm/abi.FsResult)

A file the host opened for an operation takes the slot Bend picks (src/host/fdcache.bend: the least recently used).

def Fs.run source · line 83 · raw

@sh:U32 -> @+op:U32 -> @p:String -> @p2:String -> @a:0xec4070cc970212faf4003d589ad8e6c1/src/lib/u64.U64 -> @b:U32 -> @bytes:List<&2, U32> -> IO(0xec4070cc970212faf4003d589ad8e6c1/src/vmm/abi.FsResult)

A host operation on a share: its paths' names vetted first (src/fs/contain.bend: no empty part, no "." or ".."; the host walks them without following a symlink).

def Fs.call source · line 91 · raw

@+sh:U32 -> @+op:U32 -> @+p:String -> @+p2:String -> @+a:0xec4070cc970212faf4003d589ad8e6c1/src/lib/u64.U64 -> @+b:U32 -> @+bytes:List<&2, U32> -> IO(0xec4070cc970212faf4003d589ad8e6c1/src/vmm/abi.FsResult)

def Fs.paged source · line 97 · raw

@r:0xec4070cc970212faf4003d589ad8e6c1/src/vmm/abi.FsResult -> @+from:U32 -> @+max:U32 -> 0xec4070cc970212faf4003d589ad8e6c1/src/vmm/abi.FsResult

The page of a listing the guest asked for (src/fs/entry.bend: which entries, with what type; src/fs/listing.bend: in what order).

def Host.fs.do source · line 104 · raw

@sh:U32 -> @op:0xec4070cc970212faf4003d589ad8e6c1/src/vmm/abi.FsOp -> IO(0xec4070cc970212faf4003d589ad8e6c1/src/vmm/abi.FsResult)

def Host.fs.quota source · line 139 · raw

@ok:Bool -> @sh:U32 -> @op:0xec4070cc970212faf4003d589ad8e6c1/src/vmm/abi.FsOp -> IO(0xec4070cc970212faf4003d589ad8e6c1/src/vmm/abi.FsResult)

A write past the share's quota (src/fs/quota.bend) fails with ENOSPC before it happens.

def Host.fs.grows source · line 146 · raw

@none:Bool -> @+growth:0xec4070cc970212faf4003d589ad8e6c1/src/lib/u64.U64 -> @+sh:U32 -> @op:0xec4070cc970212faf4003d589ad8e6c1/src/vmm/abi.FsOp -> IO(0xec4070cc970212faf4003d589ad8e6c1/src/vmm/abi.FsResult)

def Host.fs source · line 155 · raw

@+sh:U32 -> @+op:0xec4070cc970212faf4003d589ad8e6c1/src/vmm/abi.FsOp -> IO(0xec4070cc970212faf4003d589ad8e6c1/src/vmm/abi.FsResult)