Hi,
I am trying to implement a toy fs using the 9p protocol. I've been
reading Francisco's intro to plan 9 and section 5 of the manual pages,
and I have to say I am surprised because I am actually learning from
them; plan 9 man pages are really readable :-) (not to mention
Francisco's fine intro).
Anyway, there's one thing unclear for me and it's about fids and
references: when a client opens a connection to my server, it chooses
fids for all the files I have inside and also navigates the fs and
performs operations using these fids (which are somehow mapped to qids
in my server, but this isn't cristal clear for me; tough I know qids
are unique and fids not necessarily so). The Fid structure contains an
aux pointer to whatever I want and I am using it, but my problems
start when I want to get rid of the data pointed by aux. In my fs,
it's guaranteed that each file points to its unique data structure
(pointed by aux) and there's no way two different files point to the
same data structure (but maybe two different fids do?) so reference
counting is unnecessary, am I right? I believe that clone shouldn't be
a problem since I am creating copies of the structure instead of
passing just a reference.
I am trying to avoid dangling pointers when a file is removed without
using reference counting, is it possible?
Saludos

-- 
Hugo

Reply via email to