From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <7489e8dd7f2d225fec01b198419f89fe@felloff.net> Date: Tue, 10 Jun 2014 16:06:24 +0200 From: cinap_lenrek@felloff.net To: 9fans@9fans.net In-Reply-To: <8a74e4235d48b56ef9fd8eee42c95c74@brasstown.quanstro.net> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] duppage Topicbox-Message-UUID: f9655182-ead8-11e9-9d60-3106f5b1d025 no. my attachimage() compares qid + mountid (which is unique) and reattaches the passed in channel if image->c was nil. when a porcess exits, the segments are released, decrementing ref of the pages and the images. the image has an additional field pgref where it counts the number of page references (that is, the number of references minus the references from segments). in putimage(), when image->ref == image->pgref, we know that all references to our image are from the cache only and thats when we close the image channel and set image->c to nil. once the image gets attached again, image->c will be set again as mentioned above. this is just to avoid holding the channel reference when the image is only kept arround for the cache. so mounts will go away propery and not wait until the image is reclaimed. it will find the right image for the channel in any case. nothing has changed in that regard. -- cinap