src/fs/p9.bend checks
raw source on the hub · import 0x9e6d2577f67543fbccdbfe8fd1789f27/src/fs/p9.bend as P9
6 imports
import Base import ../lib/u64.bend as U import ../lib/bytes.bend as B import ../vmm/abi.bend as V import ../virtio/queue.bend as Q import ./p9wire.bend as W
Types
type Fid source · line 42 · raw
Data
Fid@fid:U32 -> @path:String -> @open:Bool -> Fid
type P9State source · line 45 · raw
Data
P9State@msize:U32 -> @fids:List<&2, Fid> -> P9State
type P9Answer source · line 68 · raw
Data
P9Answer@state:P9State -> @reply:List<&2, U32> -> P9Answer
type P9Walk source · line 388 · raw
Data
The outcome of a walk: an error, or the path reached, the qids found and whether every name was walked.
WalkErr@errno:U32 -> P9Walk
WalkOk@path:String -> @qids:List<&2, 0x9e6d2577f67543fbccdbfe8fd1789f27/src/fs/p9wire.Qid> -> @done:Bool -> P9Walk
type P9Pass source · line 676 · raw
Data
P9Pass@state:P9State -> @q:0x9e6d2577f67543fbccdbfe8fd1789f27/src/virtio/queue.Vq -> @used:Bool -> P9Pass
Definitions
def P9State.new source · line 48 · raw
P9State
def P9.linux_errno source · line 54 · raw
@+e:U32 -> U32
The Linux errno for a macOS errno (equal below 35; EAGAIN 35 -> 11, ENOTEMPTY 66 -> 39, ENAMETOOLONG 63 -> 36, ELOOP 62 -> 40, ENOSYS 78 -> 38, ENOTSUP 45 -> 95, others unchanged).
def P9.config source · line 64 · raw
@tag:String -> List<&2, U32>
The config space for a mount tag.
def P9.eio source · line 72 · raw
U32
Linux errnos the server answers by itself.
def P9.ebadf source · line 75 · raw
U32
def P9.einval source · line 78 · raw
U32
def P9.eopnotsupp source · line 81 · raw
U32
def P9.emfile source · line 84 · raw
U32
def P9.max_fids source · line 88 · raw
Nat
The most fids the table holds: a new fid past it is EMFILE.
def P9.mode source · line 93 · raw
@m:U32 -> U32
The permission bits a guest may set on a host file (0777): never setuid, setgid or sticky.
def P9.max_msize source · line 98 · raw
U32
The largest msize this server accepts: reads and writes move their data on the host, so a large one costs Bend nothing per byte and saves requests.
def P9.sub_sat source · line 102 · raw
@+a:U32 -> @+b:U32 -> U32
a - b, or 0 when b is larger.
def P9State.msize source · line 105 · raw
@s:P9State -> U32
def P9State.fids source · line 110 · raw
@s:P9State -> List<&2, Fid>
def P9.iounit source · line 116 · raw
@s:P9State -> U32
The I/O unit Rlopen and Rlcreate answer: msize less the Rread header.
def Fid.id source · line 119 · raw
@f:Fid -> U32
def Fid.path source · line 124 · raw
@f:Fid -> String
def P9.fid_find source · line 129 · raw
@fids:List<&2, Fid> -> @+fid:U32 -> Maybe<&2, Fid>
def P9.fid_drop.go source · line 136 · raw
@hit:Bool -> @f:Fid -> @rest:List<&2, Fid> -> List<&2, Fid>
def P9.fid_drop source · line 145 · raw
@fids:List<&2, Fid> -> @+fid:U32 -> List<&2, Fid>
The table without fid. One recursive call per entry: both arms of a Bool.pick are evaluated, so recursing in each would take 2^n steps.
def P9.room source · line 154 · raw
@bound:Bool -> @n:Nat -> Bool
Whether a fid can be bound in a table of n fids: it already is (bound), or the table has room.
def P9.fid_room source · line 158 · raw
@+fids:List<&2, Fid> -> @+fid:U32 -> Bool
Whether fid can be bound in the table fids.
def P9.bind source · line 162 · raw
@s:P9State -> @+f:Fid -> P9State
The state with fid bound to f (replacing any earlier binding).
def P9.unbind source · line 167 · raw
@s:P9State -> @+fid:U32 -> P9State
def P9.strip source · line 173 · raw
@prefix:String -> @s:String -> Maybe<&2, String>
The rest of s after prefix, if s starts with it.
def P9.moved.under source · line 182 · raw
@+to:String -> @path:String -> @r:Maybe<&2, String> -> String
def P9.moved source · line 191 · raw
@+from:String -> @+to:String -> @+path:String -> String
A path after from was renamed to to: from itself and everything under
it move.
def P9.move_fids source · line 194 · raw
@fids:List<&2, Fid> -> @+from:String -> @+to:String -> List<&2, Fid>
def P9.rename_fids source · line 201 · raw
@s:P9State -> @+from:String -> @+to:String -> P9State
def P9.chars source · line 207 · raw
@bs:List<&2, U32> -> String
A name as a host path component.
def P9.no_sep source · line 214 · raw
@bs:List<&2, U32> -> Bool
def P9.is_dot source · line 221 · raw
@bs:List<&2, U32> -> Bool
def P9.is_dotdot source · line 228 · raw
@bs:List<&2, U32> -> Bool
def P9.bytes_eq source · line 235 · raw
@xs:List<&2, U32> -> @ys:List<&2, U32> -> Bool
def P9.name_ok source · line 246 · raw
@+bs:List<&2, U32> -> Bool
Whether a name may be one path component: not empty, ".", "..", and without "/" or NUL.
def P9.join source · line 250 · raw
@+dir:String -> @+name:String -> String
A name inside directory dir ("" is the root).
def P9.qid_kind source · line 254 · raw
@+mode:U32 -> U32
The qid of a file: QTDIR for a directory, QTSYMLINK for a symlink.
def P9.qid source · line 258 · raw
@a:0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.FsAttr -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/fs/p9wire.Qid
def P9.stat source · line 263 · raw
@a:0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.FsAttr -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/fs/p9wire.P9Stat
def P9.dirent_qid source · line 269 · raw
@+kind:U32 -> @ino:0x9e6d2577f67543fbccdbfe8fd1789f27/src/lib/u64.U64 -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/fs/p9wire.Qid
The qid of a directory entry, from its DT_* type.
def P9.dirents source · line 274 · raw
@es:List<&2, 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.FsEntry> -> @+next:U32 -> @+room:U32 -> List<&2, 0x9e6d2577f67543fbccdbfe8fd1789f27/src/fs/p9wire.P9Dirent>
The entries from index next on that fit in room bytes (each takes 24 bytes plus its name).
def P9.answer source · line 286 · raw
@-R:Type -> @s:P9State -> @+tag:U32 -> @r:0x9e6d2577f67543fbccdbfe8fd1789f27/src/fs/p9wire.P9Resp -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
def P9.err source · line 289 · raw
@-R:Type -> @s:P9State -> @+tag:U32 -> @e:U32 -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
def P9.fail source · line 293 · raw
@r:0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.FsResult -> U32
The Linux errno for an answer that is not the one expected.
def P9.ok_errno source · line 301 · raw
@r:0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.FsResult -> U32
The Linux errno of an answer that should be FsOk, 0 when it is.
def P9.first source · line 309 · raw
@+a:U32 -> @b:U32 -> U32
The first nonzero errno of two.
def P9.done source · line 313 · raw
@-R:Type -> @s:P9State -> @+tag:U32 -> @+e:U32 -> @resp:0x9e6d2577f67543fbccdbfe8fd1789f27/src/fs/p9wire.P9Resp -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
Answers resp when errno e is 0, else Rlerror e.
def P9.with_fid.go source · line 317 · raw
@-R:Type -> @m:Maybe<&2, Fid> -> @s:P9State -> @+tag:U32 -> @k:(@_:Fid -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>) -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
Continues with the fid bound to fid, or answers EBADF.
def P9.with_fid source · line 324 · raw
@-R:Type -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> @k:(@_:Fid -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>) -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
def P9.with_child.go source · line 329 · raw
@-R:Type -> @ok:Bool -> @s:P9State -> @+tag:U32 -> @dir:String -> @name:List<&2, U32> -> @k:(@_:String -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>) -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
Continues with the path of name inside the directory fid names, or
answers EBADF (unknown fid) or EINVAL (bad name).
def P9.with_child source · line 336 · raw
@-R:Type -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> @+name:List<&2, U32> -> @k:(@_:String -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>) -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
def P9.on_attr source · line 340 · raw
@-R:Type -> @r:0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.FsResult -> @s:P9State -> @+tag:U32 -> @k:(@_:0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.FsAttr -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>) -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
Continues with the attributes of a FsStat answer, or answers its error.
def P9.on_ok source · line 348 · raw
@-R:Type -> @r:0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.FsResult -> @s:P9State -> @+tag:U32 -> @k:(@_:Unit -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>) -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
Continues after an FsOk answer, or answers its error.
def P9.reply_qid source · line 356 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @path:String -> @mk:(@_:0x9e6d2577f67543fbccdbfe8fd1789f27/src/fs/p9wire.Qid -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/fs/p9wire.P9Resp) -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
Stats path and answers with the response its qid makes.
def P9.version source · line 362 · raw
@-R:Type -> @+tag:U32 -> @+msize:U32 -> @version:List<&2, U32> -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
Tversion.
def P9.with_room.go source · line 369 · raw
@-R:Type -> @room:Bool -> @s:P9State -> @+tag:U32 -> @k:(@_:P9State -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>) -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
k, when fid can be bound (P9.fid_room); else Rlerror EMFILE.
def P9.with_room source · line 376 · raw
@-R:Type -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> @k:(@_:P9State -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>) -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
def P9.attach.go source · line 379 · raw
@-R:Type -> @+share:U32 -> @s:P9State -> @+tag:U32 -> @+fid:U32 -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
def P9.attach source · line 383 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
Tattach: fid names the root (EMFILE when the table is full).
def P9.walk.stop source · line 392 · raw
@+path:String -> @+qids:List<&2, 0x9e6d2577f67543fbccdbfe8fd1789f27/src/fs/p9wire.Qid> -> @r:0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.FsResult -> P9Walk
def P9.walk.after source · line 397 · raw
@-R:Type -> @r:0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.FsResult -> @+path:String -> @next:String -> @+qids:List<&2, 0x9e6d2577f67543fbccdbfe8fd1789f27/src/fs/p9wire.Qid> -> @k:(@_:String -> @_:List<&2, 0x9e6d2577f67543fbccdbfe8fd1789f27/src/fs/p9wire.Qid> -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Walk>) -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Walk>
After stating the next path: continue the walk there with k, or stop at path with the qids found so far (reversed).
def P9.walk.go source · line 409 · raw
@names:List<&2, List<&2, U32>> -> @-R:Type -> @+share:U32 -> @+path:String -> @+qids:List<&2, 0x9e6d2577f67543fbccdbfe8fd1789f27/src/fs/p9wire.Qid> -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Walk>
Walks names from path; qids holds the qids found so far, reversed. ".." of the root is the root; any other bad name refuses the whole walk.
def P9.walk.fin source · line 421 · raw
@-R:Type -> @w:P9Walk -> @s:P9State -> @+tag:U32 -> @+newfid:U32 -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
def P9.walk.from source · line 430 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> @+newfid:U32 -> @names:List<&2, List<&2, U32>> -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
def P9.walk source · line 434 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> @+newfid:U32 -> @names:List<&2, List<&2, U32>> -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
Twalk (EMFILE when newfid is new and the table is full).
def P9.getattr.go source · line 437 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @path:String -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
def P9.getattr source · line 443 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
Tgetattr.
def P9.maybe_op source · line 447 · raw
@-R:Type -> @go:Bool -> @+share:U32 -> @op:0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.FsOp -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, U32>
Runs op when go, answering the Linux errno of its result (0 for FsOk).
def P9.setattr.go source · line 456 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+path:String -> @+valid:U32 -> @mode:U32 -> @size:0x9e6d2577f67543fbccdbfe8fd1789f27/src/lib/u64.U64 -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
def P9.setattr source · line 463 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> @+valid:U32 -> @+mode:U32 -> @+size:0x9e6d2577f67543fbccdbfe8fd1789f27/src/lib/u64.U64 -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
Tsetattr: mode (valid bit 0), then size (valid bit 3); other bits ignored.
def P9.open_fid source · line 467 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> @+path:String -> @mk:(@_:0x9e6d2577f67543fbccdbfe8fd1789f27/src/fs/p9wire.Qid -> @_:U32 -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/fs/p9wire.P9Resp) -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
Binds fid to path, opened, and answers mk(qid, iounit).
def P9.lopen.go source · line 471 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> @+path:String -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
def P9.lopen source · line 475 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
Tlopen: marks the fid open.
def P9.lcreate.go source · line 478 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> @+path:String -> @mode:U32 -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
def P9.lcreate source · line 485 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> @+name:List<&2, U32> -> @+mode:U32 -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
Tlcreate: creates name in the directory fid names; fid then names the new file, opened.
def P9.mkdir.go source · line 488 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+path:String -> @mode:U32 -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
def P9.mkdir source · line 494 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+dfid:U32 -> @+name:List<&2, U32> -> @+mode:U32 -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
Tmkdir.
def P9.symlink.go source · line 497 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+path:String -> @target:List<&2, U32> -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
def P9.symlink source · line 503 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> @+name:List<&2, U32> -> @+target:List<&2, U32> -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
Tsymlink.
def P9.on_link source · line 506 · raw
@-R:Type -> @r:0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.FsResult -> @s:P9State -> @+tag:U32 -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
def P9.readlink.go source · line 513 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @path:String -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
def P9.readlink source · line 519 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
Treadlink.
def P9.on_bytes source · line 522 · raw
@-R:Type -> @r:0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.FsResult -> @s:P9State -> @+tag:U32 -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
def P9.read.go source · line 529 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @path:String -> @offset:0x9e6d2577f67543fbccdbfe8fd1789f27/src/lib/u64.U64 -> @+count:U32 -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
def P9.read source · line 536 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> @+offset:0x9e6d2577f67543fbccdbfe8fd1789f27/src/lib/u64.U64 -> @+count:U32 -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
Tread: count capped to msize - 11 (the Rread header).
def P9.on_count source · line 539 · raw
@-R:Type -> @r:0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.FsResult -> @s:P9State -> @+tag:U32 -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
def P9.write.go source · line 546 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @path:String -> @offset:0x9e6d2577f67543fbccdbfe8fd1789f27/src/lib/u64.U64 -> @data:List<&2, U32> -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
def P9.write source · line 552 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> @+offset:0x9e6d2577f67543fbccdbfe8fd1789f27/src/lib/u64.U64 -> @+data:List<&2, U32> -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
Twrite.
def P9.on_entries source · line 555 · raw
@-R:Type -> @r:0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.FsResult -> @s:P9State -> @+tag:U32 -> @+from:U32 -> @+count:U32 -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
def P9.index source · line 564 · raw
@o:0x9e6d2577f67543fbccdbfe8fd1789f27/src/lib/u64.U64 -> U32
The entry index of a readdir offset; past 2^32 nothing is left, so the index saturates.
def P9.readdir_count source · line 570 · raw
@+msize:U32 -> @+count:U32 -> U32
A Treaddir count, at most msize - 24 (the reply must fit msize).
def P9.readdir.go source · line 573 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @path:String -> @offset:0x9e6d2577f67543fbccdbfe8fd1789f27/src/lib/u64.U64 -> @count0:U32 -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
def P9.readdir source · line 582 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> @+offset:0x9e6d2577f67543fbccdbfe8fd1789f27/src/lib/u64.U64 -> @+count:U32 -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
Treaddir: entries from index offset on, as many as fit in count bytes (count at most msize - 24).
def P9.unlinkat.go source · line 585 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @path:String -> @flags:U32 -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
def P9.unlinkat source · line 592 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+dir:U32 -> @+name:List<&2, U32> -> @+flags:U32 -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
Tunlinkat: removes name from the directory dir names (a directory when flags has AT_REMOVEDIR 512).
def P9.renameat.go source · line 595 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+from:String -> @+to:String -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
def P9.renameat source · line 601 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+olddir:U32 -> @+oldname:List<&2, U32> -> @+newdir:U32 -> @+newname:List<&2, U32> -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
Trenameat: fids naming the old path, or a path under it, follow it.
def P9.on_statfs source · line 604 · raw
@-R:Type -> @r:0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.FsResult -> @s:P9State -> @+tag:U32 -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
def P9.statfs.go source · line 611 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
def P9.statfs source · line 617 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
Tstatfs.
def P9.fsync source · line 621 · raw
@-R:Type -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
Tfsync: nothing is buffered here.
def P9.clunk source · line 625 · raw
@-R:Type -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
Tclunk: forgets the fid.
def P9.serve source · line 629 · raw
@-R:Type -> @share:U32 -> @s:P9State -> @m:0x9e6d2577f67543fbccdbfe8fd1789f27/src/fs/p9wire.P9Msg -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
Serves one request on share share.
def P9.handle source · line 681 · raw
@-R:Type -> @share:U32 -> @s:P9State -> @m:Maybe<&2, 0x9e6d2577f67543fbccdbfe8fd1789f27/src/fs/p9wire.P9Msg> -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Answer>
The answer to a request's bytes: Rlerror EINVAL with tag 65535 when they are not a message.
def P9.reply_chain source · line 690 · raw
@-R:Type -> @a:P9Answer -> @q:0x9e6d2577f67543fbccdbfe8fd1789f27/src/virtio/queue.Vq -> @+h:U32 -> @w:List<&2, 0x9e6d2577f67543fbccdbfe8fd1789f27/src/virtio/queue.Desc> -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Pass>
Writes the reply into the chain and pushes it used with the length that fit the writable descriptors (the whole reply when they hold it).
def P9.reply_err source · line 699 · raw
@-R:Type -> @s:P9State -> @+tag:U32 -> @e:U32 -> @q:0x9e6d2577f67543fbccdbfe8fd1789f27/src/virtio/queue.Vq -> @+h:U32 -> @w:List<&2, 0x9e6d2577f67543fbccdbfe8fd1789f27/src/virtio/queue.Desc> -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Pass>
Answers an error the generic way.
def P9.read_done.ok source · line 704 · raw
@-R:Type -> @s:P9State -> @+tag:U32 -> @+n:U32 -> @q:0x9e6d2577f67543fbccdbfe8fd1789f27/src/virtio/queue.Vq -> @+h:U32 -> @+w:List<&2, 0x9e6d2577f67543fbccdbfe8fd1789f27/src/virtio/queue.Desc> -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Pass>
def P9.read_done source · line 714 · raw
@-R:Type -> @s:P9State -> @+tag:U32 -> @r:0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.FsResult -> @q:0x9e6d2577f67543fbccdbfe8fd1789f27/src/virtio/queue.Vq -> @+h:U32 -> @+w:List<&2, 0x9e6d2577f67543fbccdbfe8fd1789f27/src/virtio/queue.Desc> -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Pass>
Rread of the n bytes FsReadRam put in the chain's memory: its 11-byte header {size, 117, tag, count} goes in front of them. An error the generic way.
def P9.read_fast.go source · line 721 · raw
@-R:Type -> @m:Maybe<&2, Fid> -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @offset:0x9e6d2577f67543fbccdbfe8fd1789f27/src/lib/u64.U64 -> @+count:U32 -> @q:0x9e6d2577f67543fbccdbfe8fd1789f27/src/virtio/queue.Vq -> @+h:U32 -> @+w:List<&2, 0x9e6d2577f67543fbccdbfe8fd1789f27/src/virtio/queue.Desc> -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Pass>
def P9.read_fast source · line 736 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+hdr:List<&2, U32> -> @q:0x9e6d2577f67543fbccdbfe8fd1789f27/src/virtio/queue.Vq -> @+h:U32 -> @+w:List<&2, 0x9e6d2577f67543fbccdbfe8fd1789f27/src/virtio/queue.Desc> -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Pass>
Tread: the data goes from the file straight into the chain's memory after the Rread header (count capped to msize - 11 and to the room).
def P9.write_fast.go source · line 743 · raw
@-R:Type -> @m:Maybe<&2, Fid> -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @offset:0x9e6d2577f67543fbccdbfe8fd1789f27/src/lib/u64.U64 -> @ss:List<&2, 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Iov> -> @q:0x9e6d2577f67543fbccdbfe8fd1789f27/src/virtio/queue.Vq -> @+h:U32 -> @+w:List<&2, 0x9e6d2577f67543fbccdbfe8fd1789f27/src/virtio/queue.Desc> -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Pass>
def P9.write_fast source · line 757 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+hdr:List<&2, U32> -> @r:List<&2, 0x9e6d2577f67543fbccdbfe8fd1789f27/src/virtio/queue.Desc> -> @q:0x9e6d2577f67543fbccdbfe8fd1789f27/src/virtio/queue.Vq -> @+h:U32 -> @+w:List<&2, 0x9e6d2577f67543fbccdbfe8fd1789f27/src/virtio/queue.Desc> -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Pass>
Twrite: the data goes from the chain's memory after the 23-byte header straight to the file (at most count bytes).
def P9.path source · line 766 · raw
@+hdr:List<&2, U32> -> Nat
Which way a request is served, from its first 23 bytes: 1 Tread, 2 Twrite (both exactly 23-byte headers), else 0 (the whole message through Bend).
def P9.serve_whole source · line 774 · raw
@-R:Type -> @long:Bool -> @+share:U32 -> @s:P9State -> @q:0x9e6d2577f67543fbccdbfe8fd1789f27/src/virtio/queue.Vq -> @+h:U32 -> @ss:List<&2, 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Iov> -> @+w:List<&2, 0x9e6d2577f67543fbccdbfe8fd1789f27/src/virtio/queue.Desc> -> @hdr:List<&2, U32> -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Pass>
A request served whole: its readable bytes ss (at most msize + 1 of them) are parsed, unless they pass msize (long): Rlerror EINVAL with the tag of hdr, nothing more read.
def P9.serve_path source · line 784 · raw
@-R:Type -> @k:Nat -> @+share:U32 -> @+s:P9State -> @q:0x9e6d2577f67543fbccdbfe8fd1789f27/src/virtio/queue.Vq -> @+h:U32 -> @+r:List<&2, 0x9e6d2577f67543fbccdbfe8fd1789f27/src/virtio/queue.Desc> -> @+w:List<&2, 0x9e6d2577f67543fbccdbfe8fd1789f27/src/virtio/queue.Desc> -> @+hdr:List<&2, U32> -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Pass>
def P9.serve_chain source · line 797 · raw
@-R:Type -> @+share:U32 -> @s:P9State -> @q:0x9e6d2577f67543fbccdbfe8fd1789f27/src/virtio/queue.Vq -> @c:0x9e6d2577f67543fbccdbfe8fd1789f27/src/virtio/queue.Chain -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Pass>
Serves one chain. Reads and writes move their data between the file and the chain's memory on the host; every other request is parsed whole.
def P9.step source · line 806 · raw
@-R:Type -> @+share:U32 -> @s:P9State -> @r:Pair(0x9e6d2577f67543fbccdbfe8fd1789f27/src/virtio/queue.Vq, Maybe<&2, 0x9e6d2577f67543fbccdbfe8fd1789f27/src/virtio/queue.Chain>) -> @used:Bool -> @k:(@_:P9Pass -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Pass>) -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Pass>
After a pop: stops on an empty queue, else serves the chain and continues with k.
def P9.go source · line 814 · raw
@fuel:Nat -> @-R:Type -> @+share:U32 -> @p:P9Pass -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Pass>
Pops and serves chains, at most fuel of them.
def P9.process source · line 828 · raw
@-R:Type -> @share:U32 -> @s:P9State -> @q:0x9e6d2577f67543fbccdbfe8fd1789f27/src/virtio/queue.Vq -> 0x9e6d2577f67543fbccdbfe8fd1789f27/src/vmm/abi.Op<R, P9Pass>
Serves every available chain (at most num): the request is the chain's readable bytes, the reply goes to its writable descriptors, pushed used with the reply's length. A malformed request gets Rlerror EINVAL with tag 65535.