xref: /plan9-contrib/sys/src/cmd/fscfs/notes (revision 4366bb713c6d061e46ce8907c3b6797dc3f83d93)
1- file length (to avoid having to forward reads to detect end of file)
2
3- virtual directories, reading a directory wipes out the
4 virtual directory. virtual property in the inode.
5
6- inode contains the qid, inuse, pointers, and virtual
7 property.  one pointer each for 3 levels.
8
9? reserve version == -1 to mean a virtual file? makes
10 some things easier.
11
12- first inode is always the root.
13
14- adding any virtual entry to a directory makes the
15 whole directory virtual.
16
17? how do we resolve access to missing parts when running
18 remotely?
19
20? what are default properties of files (ones we haven't
21 stat'd)?
22
23- local walk won't move fid remotely: must later walk fid if it's needed at the server,
24   or hold a local clone (perhaps in special fid space) representing the result of the walk
25
26- why not use exportfs's scheme (turn them back into system calls as needed)?
27    after all, currently the clients actually use exportfs connection
28	- auth?
29- why not just add cache to exportfs?
30	- need shared cache
31
32- QTEXCL should pass through (ok for cfs because opens already do)
33- permission checks on open?
34
35- shared writable files?
36
37- cfs assumes T -> R in order
38
39- could re-use tag of incoming op (probably assumes in order, or put client id in high-order bits)
40
41x String hash table
42
43- auth interaction, and attach
44
45- fid management different for input from clients and output to server
46
47- if any client has fid to file, server has fid to file
48- if no client has fid to file, server might have fid to file (LRU)
49- if any client has fid open, server has fid open (BUT: modes, auth)
50- if no client has fid open, server will not have fid open (for now)
51	- OREAD, OWRITE, ORDWR, OEXEC(!)
52	- OTRUNC [if not QTAPPEND]
53	- OEXCL
54	- ORCLOSE
55	- OCEXEC (not in protocol)
56- initially it's probably adequate to cache only OREAD
57
58fid walk
59- Path has optional SFid
60- root has SFid from Tattach
61	- must not be lost, in case of later attaches
62- all local attach fids are bound to root.sfid
63- if not localwalk, allocate SFid and walk that
64	- if walks to Path with SFid, clunk and substitute
65	(in non-concurrent system, can't happen? because localwalk would have returned it)
66
67attach and auth handling
68- attach can't be done until successful Tauth
69- Tauth just introduces a fid for Tread/Twrite[/Tclunk]
70	- need to assume that existing Attach with similar parameters is adequate authentication
71	(obviously wrong, because another incoming connection saying Tauth might not represent the
72	same principal. with one connection, it hardly matters, because if it's shared,
73	spoofing could occur by fid substitution if the connection can't be trusted.
74	also, in this particular application, it's usually safe to assume that every connection is either the
75	same principal or "none". trust lies in the authentication of the connection, and the associated "speaks for"
76	relationship.)
77
78- private sfid in ropen/rcreate for isdirect files; must clunk
79
80- Path's SFid is only walkable; Fid must have separate path to (possibly shared) SFid for IO
81
82- I/O fids should be shared (unless impossible)
83	- can't share QTEXCL, or QTDIR [offset clashes]
84	- for QTDIR, could read whole directory and cache that, with purely local fid,
85		or read and accumulate contents incrementally
86	- need a way to find the shared fid
87		- stored in File? as at present [one for each possible mode]
88		- map [hash] qid.path x (mode&3) x rclose -> SFid
89		- first open in given mode -> clone Path's SFid (as at present)
90	- have Fid.open: SFid -> shared fid once located?
91		- also private SFid when needed (eg, isdirect, ORCLOSE)
92	- Qid changes on open (eg, clone)
93		- might detect change of qid.path on first open and mark File as volatile
94		    (enough to discard File reference from Path)
95