From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <138575260907300825p4b005c50o990df6ff2a0c68cc@mail.gmail.com> References: <138575260907300825p4b005c50o990df6ff2a0c68cc@mail.gmail.com> Date: Thu, 30 Jul 2009 17:01:44 +0100 Message-ID: From: roger peppe To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [9fans] 9p fids and references Topicbox-Message-UUID: 32655e86-ead5-11e9-9d60-3106f5b1d025 2009/7/30 hugo rivera : > [...] 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? no, because a file can be opened several times. when you open a file you get a new fid. so if you've got resources associated with the file, as opposed to resources private to the fid, you have to reference count them (or poison any fids that point to the file, if you *really* want the resource to go away)