diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-10-02 11:21:55 -0600 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-10-02 11:21:55 -0600 |
commit | ada828fc3eaf9891e1bbb6503106d36ef53b6c8a (patch) | |
tree | 897cb32a2656f72b5bbafa250fffc97895f74785 /lib9p/9P2000.txt | |
parent | 205f7479c30d13bb78c0949148d975e0975655f9 (diff) |
wip lib9p bitfields
Diffstat (limited to 'lib9p/9P2000.txt')
-rw-r--r-- | lib9p/9P2000.txt | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/lib9p/9P2000.txt b/lib9p/9P2000.txt index 5f93cdf..3f1f10a 100644 --- a/lib9p/9P2000.txt +++ b/lib9p/9P2000.txt @@ -30,8 +30,39 @@ d = "len[4] len*(dat[1])" # string (u16le `n`, then `n` bytes of UTF-8) s = "len[2] len*(utf8[1])" -# qid (TODO) -qid = "type[1] vers[4] path[8]" +bitfield qid_type 8 + 7/DIR + 6/APPEND + 5/EXCL + # QTMOUNT has been around in Plan 9 forever, but is + # undocumented, and is explicitly excluded from the 9P2000 + # draft RFC. As I understand it, QTMOUNT indicates that the + # file is mounted by the kernel as a 9P transport; that the + # kernel has a lock on doing I/O on it, so userspace can't do + # I/O on it. + 4/_PLAN9_MOUNT + 3/AUTH + # Fun historical fact: QTTMP was a relatively late addition to + # Plan 9, in 2003-12. + 2/TMP + #1/unused + FILE=0 + +# uniQue IDentification - "two files on the same server hierarchy are +# the same if and only if their qids are the same" +# +# - "path" is a unique uint64_t that does most of the work in the +# above statement about files being the same if their QIDs are the +# same; " If a file is deleted and recreated with the same name in +# the same directory, the old and new path components of the qids +# should be different" +# +# - "vers" "is a version number for a file; typically, it is +# incremented every time the file is modified. +# +# - "type" indicates "whether the file is a directory, append-only +# file, etc."; is an instance of the qid_type bitfield. +qid = "type[qid_type] vers[4] path[8]" # stat (TODO) stat = "stat_size[2]" |