src/fs/p9.bend checks
raw source on the hub · import 0x79c2f5323029fcb91b9cbd02db6800f6/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 P9XPath source · line 45 · raw
Data
P9XPath@name:String -> @path:String -> P9XPath
type P9State source · line 48 · raw
Data
P9State@msize:U32 -> @fids:List<&2, Fid> -> P9State
type P9Answer source · line 71 · raw
Data
P9Answer@state:P9State -> @reply:List<&2, U32> -> P9Answer
type P9Walk source · line 426 · 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, 0x79c2f5323029fcb91b9cbd02db6800f6/src/fs/p9wire.Qid> -> @done:Bool -> P9Walk
type P9Pass source · line 765 · raw
Data
P9Pass@state:P9State -> @q:0x79c2f5323029fcb91b9cbd02db6800f6/src/virtio/queue.Vq -> @used:Bool -> P9Pass
Definitions
def P9State.new source · line 51 · raw
P9State
def P9.linux_errno source · line 57 · 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 67 · raw
@tag:String -> List<&2, U32>
The config space for a mount tag.
def P9.eio source · line 75 · raw
U32
Linux errnos the server answers by itself.
def P9.ebadf source · line 78 · raw
U32
def P9.einval source · line 81 · raw
U32
def P9.eopnotsupp source · line 84 · raw
U32
def P9.emfile source · line 87 · raw
U32
def P9.max_fids source · line 91 · raw
Nat
The most fids the table holds: a new fid past it is EMFILE.
def P9.mode source · line 96 · 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 101 · 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 105 · raw
@+a:U32 -> @+b:U32 -> U32
a - b, or 0 when b is larger.
def P9State.msize source · line 108 · raw
@s:P9State -> U32
def P9State.fids source · line 113 · raw
@s:P9State -> List<&2, Fid>
def P9.iounit source · line 119 · raw
@s:P9State -> U32
The I/O unit Rlopen and Rlcreate answer: msize less the Rread header.
def Fid.id source · line 122 · raw
@f:Fid -> U32
def Fid.path source · line 127 · raw
@f:Fid -> String
def P9.fid_find source · line 132 · raw
@fids:List<&2, Fid> -> @+fid:U32 -> Maybe<&2, Fid>
def P9.fid_drop.go source · line 139 · raw
@hit:Bool -> @f:Fid -> @rest:List<&2, Fid> -> List<&2, Fid>
def P9.fid_drop source · line 148 · 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 157 · 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 161 · raw
@+fids:List<&2, Fid> -> @+fid:U32 -> Bool
Whether fid can be bound in the table fids.
def P9.bind source · line 165 · raw
@s:P9State -> @+f:Fid -> P9State
The state with fid bound to f (replacing any earlier binding).
def P9.unbind source · line 170 · raw
@s:P9State -> @+fid:U32 -> P9State
def P9.strip source · line 176 · 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 185 · raw
@+to:String -> @path:String -> @r:Maybe<&2, String> -> String
def P9.moved source · line 194 · 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 197 · raw
@fids:List<&2, Fid> -> @+from:String -> @+to:String -> List<&2, Fid>
def P9.rename_fids source · line 204 · raw
@s:P9State -> @+from:String -> @+to:String -> P9State
def P9.chars source · line 210 · raw
@bs:List<&2, U32> -> String
A name as a host path component.
def P9.no_sep source · line 217 · raw
@bs:List<&2, U32> -> Bool
def P9.is_dot source · line 224 · raw
@bs:List<&2, U32> -> Bool
def P9.is_dotdot source · line 231 · raw
@bs:List<&2, U32> -> Bool
def P9.bytes_eq source · line 238 · raw
@xs:List<&2, U32> -> @ys:List<&2, U32> -> Bool
def P9.name_ok source · line 249 · 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 253 · raw
@+dir:String -> @+name:String -> String
A name inside directory dir ("" is the root).
def P9.xpath source · line 259 · raw
@+name:String -> @+path:String -> String
A fid Txattrwalk binds reads an extended attribute: its path is a 0 byte, the attribute's name, a 0 byte, then the file's path (no real path holds a 0 byte: P9.name_ok refuses one).
def P9.is_xpath source · line 262 · raw
@p:String -> Bool
def P9.xcut.add source · line 269 · raw
@+c:Char -> @k:P9XPath -> P9XPath
def P9.xcut source · line 275 · raw
@s:String -> P9XPath
An xattr fid's attribute name and file path.
def P9.xsplit source · line 282 · raw
@p:String -> P9XPath
def P9.qid_kind source · line 290 · raw
@+mode:U32 -> U32
The qid of a file: QTDIR for a directory, QTSYMLINK for a symlink.
def P9.qid source · line 294 · raw
@a:0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.FsAttr -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/fs/p9wire.Qid
def P9.stat source · line 299 · raw
@a:0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.FsAttr -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/fs/p9wire.P9Stat
def P9.dirent_qid source · line 305 · raw
@+kind:U32 -> @ino:0x79c2f5323029fcb91b9cbd02db6800f6/src/lib/u64.U64 -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/fs/p9wire.Qid
The qid of a directory entry, from its DT_* type.
def P9.dirents source · line 310 · raw
@es:List<&2, 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.FsEntry> -> @+next:U32 -> @+room:U32 -> List<&2, 0x79c2f5323029fcb91b9cbd02db6800f6/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 322 · raw
@-R:Type -> @s:P9State -> @+tag:U32 -> @r:0x79c2f5323029fcb91b9cbd02db6800f6/src/fs/p9wire.P9Resp -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
def P9.err source · line 325 · raw
@-R:Type -> @s:P9State -> @+tag:U32 -> @e:U32 -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
def P9.fail source · line 329 · raw
@r:0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.FsResult -> U32
The Linux errno for an answer that is not the one expected.
def P9.ok_errno source · line 337 · raw
@r:0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.FsResult -> U32
The Linux errno of an answer that should be FsOk, 0 when it is.
def P9.first source · line 345 · raw
@+a:U32 -> @b:U32 -> U32
The first nonzero errno of two.
def P9.done source · line 349 · raw
@-R:Type -> @s:P9State -> @+tag:U32 -> @+e:U32 -> @resp:0x79c2f5323029fcb91b9cbd02db6800f6/src/fs/p9wire.P9Resp -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
Answers resp when errno e is 0, else Rlerror e.
def P9.with_fid.go source · line 353 · raw
@-R:Type -> @m:Maybe<&2, Fid> -> @s:P9State -> @+tag:U32 -> @k:(@_:Fid -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>) -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
Continues with the fid bound to fid, or answers EBADF.
def P9.with_fid source · line 360 · raw
@-R:Type -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> @k:(@_:Fid -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>) -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
def P9.with_child.go source · line 365 · raw
@-R:Type -> @ok:Bool -> @s:P9State -> @+tag:U32 -> @dir:String -> @name:List<&2, U32> -> @k:(@_:String -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>) -> 0x79c2f5323029fcb91b9cbd02db6800f6/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 372 · raw
@-R:Type -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> @+name:List<&2, U32> -> @k:(@_:String -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>) -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
def P9.on_attr source · line 376 · raw
@-R:Type -> @r:0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.FsResult -> @s:P9State -> @+tag:U32 -> @k:(@_:0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.FsAttr -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>) -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
Continues with the attributes of a FsStat answer, or answers its error.
def P9.on_ok source · line 386 · raw
@-R:Type -> @r:0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.FsResult -> @s:P9State -> @+tag:U32 -> @k:(@_:Unit -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>) -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
Continues after an FsOk answer, or answers its error.
def P9.reply_qid source · line 394 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @path:String -> @mk:(@_:0x79c2f5323029fcb91b9cbd02db6800f6/src/fs/p9wire.Qid -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/fs/p9wire.P9Resp) -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
Stats path and answers with the response its qid makes.
def P9.version source · line 400 · raw
@-R:Type -> @+tag:U32 -> @+msize:U32 -> @version:List<&2, U32> -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
Tversion.
def P9.with_room.go source · line 407 · raw
@-R:Type -> @room:Bool -> @s:P9State -> @+tag:U32 -> @k:(@_:P9State -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>) -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
k, when fid can be bound (P9.fid_room); else Rlerror EMFILE.
def P9.with_room source · line 414 · raw
@-R:Type -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> @k:(@_:P9State -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>) -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
def P9.attach.go source · line 417 · raw
@-R:Type -> @+share:U32 -> @s:P9State -> @+tag:U32 -> @+fid:U32 -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
def P9.attach source · line 421 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
Tattach: fid names the root (EMFILE when the table is full).
def P9.walk.stop source · line 430 · raw
@+path:String -> @+qids:List<&2, 0x79c2f5323029fcb91b9cbd02db6800f6/src/fs/p9wire.Qid> -> @r:0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.FsResult -> P9Walk
def P9.walk.after source · line 435 · raw
@-R:Type -> @r:0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.FsResult -> @+path:String -> @+next:String -> @+qids:List<&2, 0x79c2f5323029fcb91b9cbd02db6800f6/src/fs/p9wire.Qid> -> @k:(@_:String -> @_:List<&2, 0x79c2f5323029fcb91b9cbd02db6800f6/src/fs/p9wire.Qid> -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Walk>) -> 0x79c2f5323029fcb91b9cbd02db6800f6/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 449 · raw
@names:List<&2, List<&2, U32>> -> @-R:Type -> @+share:U32 -> @+path:String -> @+qids:List<&2, 0x79c2f5323029fcb91b9cbd02db6800f6/src/fs/p9wire.Qid> -> 0x79c2f5323029fcb91b9cbd02db6800f6/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 461 · raw
@-R:Type -> @w:P9Walk -> @s:P9State -> @+tag:U32 -> @+newfid:U32 -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
def P9.walk.from source · line 470 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> @+newfid:U32 -> @names:List<&2, List<&2, U32>> -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
def P9.walk source · line 474 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> @+newfid:U32 -> @names:List<&2, List<&2, U32>> -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
Twalk (EMFILE when newfid is new and the table is full).
def P9.rdev source · line 479 · raw
@+major:U32 -> @+minor:U32 -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/lib/u64.U64
A device's number as Linux packs it for 9p (new_encode_dev: the minor's low 8 bits, the major above them, the minor's high bits above that).
def P9.getattr.got source · line 482 · raw
@-R:Type -> @r:0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.FsResult -> @+s:P9State -> @+tag:U32 -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
def P9.getattr.go source · line 489 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @path:String -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
def P9.getattr source · line 495 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
Tgetattr.
def P9.maybe_op source · line 499 · raw
@-R:Type -> @go:Bool -> @+share:U32 -> @op:0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.FsOp -> 0x79c2f5323029fcb91b9cbd02db6800f6/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 508 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+path:String -> @+valid:U32 -> @mode:U32 -> @size:0x79c2f5323029fcb91b9cbd02db6800f6/src/lib/u64.U64 -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
def P9.setattr source · line 515 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> @+valid:U32 -> @+mode:U32 -> @+size:0x79c2f5323029fcb91b9cbd02db6800f6/src/lib/u64.U64 -> 0x79c2f5323029fcb91b9cbd02db6800f6/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 519 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> @+path:String -> @mk:(@_:0x79c2f5323029fcb91b9cbd02db6800f6/src/fs/p9wire.Qid -> @_:U32 -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/fs/p9wire.P9Resp) -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
Binds fid to path, opened, and answers mk(qid, iounit).
def P9.lopen.go source · line 523 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> @+path:String -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
def P9.lopen source · line 527 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
Tlopen: marks the fid open.
def P9.lcreate.go source · line 530 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> @+path:String -> @mode:U32 -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
def P9.lcreate source · line 537 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> @+name:List<&2, U32> -> @+mode:U32 -> 0x79c2f5323029fcb91b9cbd02db6800f6/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 540 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+path:String -> @mode:U32 -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
def P9.mkdir source · line 546 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+dfid:U32 -> @+name:List<&2, U32> -> @+mode:U32 -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
Tmkdir.
def P9.symlink.go source · line 549 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+path:String -> @target:List<&2, U32> -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
def P9.symlink source · line 555 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> @+name:List<&2, U32> -> @+target:List<&2, U32> -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
Tsymlink.
def P9.on_link source · line 558 · raw
@-R:Type -> @r:0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.FsResult -> @s:P9State -> @+tag:U32 -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
def P9.readlink.go source · line 565 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @path:String -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
def P9.readlink source · line 571 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
Treadlink.
def P9.on_bytes source · line 574 · raw
@-R:Type -> @r:0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.FsResult -> @s:P9State -> @+tag:U32 -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
def P9.read.file source · line 581 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @path:String -> @offset:0x79c2f5323029fcb91b9cbd02db6800f6/src/lib/u64.U64 -> @+count:U32 -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
def P9.xread.got source · line 589 · raw
@-R:Type -> @r:0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.FsResult -> @+s:P9State -> @+tag:U32 -> @+offset:0x79c2f5323029fcb91b9cbd02db6800f6/src/lib/u64.U64 -> @+count:U32 -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
A read on an xattr fid: the attribute's value from offset on, at most count bytes (and what fits an Rread).
def P9.xread.of source · line 597 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @x:P9XPath -> @+offset:0x79c2f5323029fcb91b9cbd02db6800f6/src/lib/u64.U64 -> @+count:U32 -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
def P9.read.go source · line 604 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+path:String -> @+offset:0x79c2f5323029fcb91b9cbd02db6800f6/src/lib/u64.U64 -> @+count:U32 -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
def P9.read source · line 608 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> @+offset:0x79c2f5323029fcb91b9cbd02db6800f6/src/lib/u64.U64 -> @+count:U32 -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
Tread: count capped to msize - 11 (the Rread header).
def P9.on_count source · line 611 · raw
@-R:Type -> @r:0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.FsResult -> @s:P9State -> @+tag:U32 -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
def P9.write.go source · line 618 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @path:String -> @offset:0x79c2f5323029fcb91b9cbd02db6800f6/src/lib/u64.U64 -> @data:List<&2, U32> -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
def P9.write source · line 624 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> @+offset:0x79c2f5323029fcb91b9cbd02db6800f6/src/lib/u64.U64 -> @+data:List<&2, U32> -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
Twrite.
def P9.on_entries source · line 627 · raw
@-R:Type -> @r:0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.FsResult -> @s:P9State -> @+tag:U32 -> @+from:U32 -> @+count:U32 -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
def P9.index source · line 636 · raw
@o:0x79c2f5323029fcb91b9cbd02db6800f6/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 642 · raw
@+msize:U32 -> @+count:U32 -> U32
A Treaddir count, at most msize - 24 (the reply must fit msize).
def P9.readdir.go source · line 645 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @path:String -> @offset:0x79c2f5323029fcb91b9cbd02db6800f6/src/lib/u64.U64 -> @count0:U32 -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
def P9.readdir source · line 654 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> @+offset:0x79c2f5323029fcb91b9cbd02db6800f6/src/lib/u64.U64 -> @+count:U32 -> 0x79c2f5323029fcb91b9cbd02db6800f6/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 657 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @path:String -> @flags:U32 -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
def P9.unlinkat source · line 664 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+dir:U32 -> @+name:List<&2, U32> -> @+flags:U32 -> 0x79c2f5323029fcb91b9cbd02db6800f6/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 667 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+from:String -> @+to:String -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
def P9.renameat source · line 673 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+olddir:U32 -> @+oldname:List<&2, U32> -> @+newdir:U32 -> @+newname:List<&2, U32> -> 0x79c2f5323029fcb91b9cbd02db6800f6/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 676 · raw
@-R:Type -> @r:0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.FsResult -> @s:P9State -> @+tag:U32 -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
def P9.statfs.go source · line 683 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
def P9.statfs source · line 689 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
Tstatfs.
def P9.fsync source · line 693 · raw
@-R:Type -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
Tfsync: nothing is buffered here.
def P9.clunk source · line 697 · raw
@-R:Type -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
Tclunk: forgets the fid.
def P9.xattrwalk.got source · line 702 · raw
@-R:Type -> @r:0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.FsResult -> @+s:P9State -> @+tag:U32 -> @+newfid:U32 -> @+xp:String -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
Txattrwalk: newfid reads the attribute name of fid's file (name "": the list of its names); Rxattrwalk answers the value's size.
def P9.xattrwalk.go source · line 709 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+newfid:U32 -> @+path:String -> @+name:String -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
def P9.xattrwalk source · line 714 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+fid:U32 -> @+newfid:U32 -> @+name:List<&2, U32> -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
def P9.serve source · line 718 · raw
@-R:Type -> @share:U32 -> @s:P9State -> @m:0x79c2f5323029fcb91b9cbd02db6800f6/src/fs/p9wire.P9Msg -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Answer>
Serves one request on share share.
def P9.handle source · line 770 · raw
@-R:Type -> @share:U32 -> @s:P9State -> @m:Maybe<&2, 0x79c2f5323029fcb91b9cbd02db6800f6/src/fs/p9wire.P9Msg> -> 0x79c2f5323029fcb91b9cbd02db6800f6/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 779 · raw
@-R:Type -> @a:P9Answer -> @q:0x79c2f5323029fcb91b9cbd02db6800f6/src/virtio/queue.Vq -> @+h:U32 -> @w:List<&2, 0x79c2f5323029fcb91b9cbd02db6800f6/src/virtio/queue.Desc> -> 0x79c2f5323029fcb91b9cbd02db6800f6/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 788 · raw
@-R:Type -> @s:P9State -> @+tag:U32 -> @e:U32 -> @q:0x79c2f5323029fcb91b9cbd02db6800f6/src/virtio/queue.Vq -> @+h:U32 -> @w:List<&2, 0x79c2f5323029fcb91b9cbd02db6800f6/src/virtio/queue.Desc> -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Pass>
Answers an error the generic way.
def P9.read_done.ok source · line 793 · raw
@-R:Type -> @s:P9State -> @+tag:U32 -> @+n:U32 -> @q:0x79c2f5323029fcb91b9cbd02db6800f6/src/virtio/queue.Vq -> @+h:U32 -> @+w:List<&2, 0x79c2f5323029fcb91b9cbd02db6800f6/src/virtio/queue.Desc> -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Pass>
def P9.read_done source · line 803 · raw
@-R:Type -> @s:P9State -> @+tag:U32 -> @r:0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.FsResult -> @q:0x79c2f5323029fcb91b9cbd02db6800f6/src/virtio/queue.Vq -> @+h:U32 -> @+w:List<&2, 0x79c2f5323029fcb91b9cbd02db6800f6/src/virtio/queue.Desc> -> 0x79c2f5323029fcb91b9cbd02db6800f6/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.ram source · line 810 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @path:String -> @offset:0x79c2f5323029fcb91b9cbd02db6800f6/src/lib/u64.U64 -> @+count:U32 -> @q:0x79c2f5323029fcb91b9cbd02db6800f6/src/virtio/queue.Vq -> @+h:U32 -> @+w:List<&2, 0x79c2f5323029fcb91b9cbd02db6800f6/src/virtio/queue.Desc> -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Pass>
def P9.read_fast.go source · line 817 · raw
@-R:Type -> @m:Maybe<&2, Fid> -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @+offset:0x79c2f5323029fcb91b9cbd02db6800f6/src/lib/u64.U64 -> @+count:U32 -> @+q:0x79c2f5323029fcb91b9cbd02db6800f6/src/virtio/queue.Vq -> @+h:U32 -> @+w:List<&2, 0x79c2f5323029fcb91b9cbd02db6800f6/src/virtio/queue.Desc> -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Pass>
def P9.read_fast source · line 831 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+hdr:List<&2, U32> -> @q:0x79c2f5323029fcb91b9cbd02db6800f6/src/virtio/queue.Vq -> @+h:U32 -> @+w:List<&2, 0x79c2f5323029fcb91b9cbd02db6800f6/src/virtio/queue.Desc> -> 0x79c2f5323029fcb91b9cbd02db6800f6/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 838 · raw
@-R:Type -> @m:Maybe<&2, Fid> -> @+share:U32 -> @+s:P9State -> @+tag:U32 -> @offset:0x79c2f5323029fcb91b9cbd02db6800f6/src/lib/u64.U64 -> @ss:List<&2, 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Iov> -> @q:0x79c2f5323029fcb91b9cbd02db6800f6/src/virtio/queue.Vq -> @+h:U32 -> @+w:List<&2, 0x79c2f5323029fcb91b9cbd02db6800f6/src/virtio/queue.Desc> -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Pass>
def P9.write_fast source · line 852 · raw
@-R:Type -> @+share:U32 -> @+s:P9State -> @+hdr:List<&2, U32> -> @r:List<&2, 0x79c2f5323029fcb91b9cbd02db6800f6/src/virtio/queue.Desc> -> @q:0x79c2f5323029fcb91b9cbd02db6800f6/src/virtio/queue.Vq -> @+h:U32 -> @+w:List<&2, 0x79c2f5323029fcb91b9cbd02db6800f6/src/virtio/queue.Desc> -> 0x79c2f5323029fcb91b9cbd02db6800f6/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 861 · 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 869 · raw
@-R:Type -> @long:Bool -> @+share:U32 -> @s:P9State -> @q:0x79c2f5323029fcb91b9cbd02db6800f6/src/virtio/queue.Vq -> @+h:U32 -> @ss:List<&2, 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Iov> -> @+w:List<&2, 0x79c2f5323029fcb91b9cbd02db6800f6/src/virtio/queue.Desc> -> @hdr:List<&2, U32> -> 0x79c2f5323029fcb91b9cbd02db6800f6/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 879 · raw
@-R:Type -> @k:Nat -> @+share:U32 -> @+s:P9State -> @q:0x79c2f5323029fcb91b9cbd02db6800f6/src/virtio/queue.Vq -> @+h:U32 -> @+r:List<&2, 0x79c2f5323029fcb91b9cbd02db6800f6/src/virtio/queue.Desc> -> @+w:List<&2, 0x79c2f5323029fcb91b9cbd02db6800f6/src/virtio/queue.Desc> -> @+hdr:List<&2, U32> -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Pass>
def P9.serve_chain source · line 892 · raw
@-R:Type -> @+share:U32 -> @s:P9State -> @q:0x79c2f5323029fcb91b9cbd02db6800f6/src/virtio/queue.Vq -> @c:0x79c2f5323029fcb91b9cbd02db6800f6/src/virtio/queue.Chain -> 0x79c2f5323029fcb91b9cbd02db6800f6/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 901 · raw
@-R:Type -> @+share:U32 -> @s:P9State -> @r:Pair(0x79c2f5323029fcb91b9cbd02db6800f6/src/virtio/queue.Vq, Maybe<&2, 0x79c2f5323029fcb91b9cbd02db6800f6/src/virtio/queue.Chain>) -> @used:Bool -> @k:(@_:P9Pass -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Pass>) -> 0x79c2f5323029fcb91b9cbd02db6800f6/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 909 · raw
@fuel:Nat -> @-R:Type -> @+share:U32 -> @p:P9Pass -> 0x79c2f5323029fcb91b9cbd02db6800f6/src/vmm/abi.Op<R, P9Pass>
Pops and serves chains, at most fuel of them.
def P9.process source · line 923 · raw
@-R:Type -> @share:U32 -> @s:P9State -> @q:0x79c2f5323029fcb91b9cbd02db6800f6/src/virtio/queue.Vq -> 0x79c2f5323029fcb91b9cbd02db6800f6/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.