From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@9fans.net Subject: Re: [9fans] store 9p session-only values using lib9p From: "Russ Cox" Date: Wed, 11 Jun 2008 16:48:32 -0400 In-Reply-To: <0c2d4885e85a65f8cb0fba1ed4d12336@9grid.es> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Message-Id: <20080611204639.62E401E8C53@holo.morphisms.net> Topicbox-Message-UUID: bafc94fa-ead3-11e9-9d60-3106f5b1d025 > If i save the offset adjustment in f->aux or simmilar, > i can calculate the real file offset on the next T-reads, > but that will only work if one client reads it at one time. No it won't. Even if just one client is reading, that client might seek. You could assume that most reads will pick up where the last one left off, and use f->aux to point at a single hint that you can check. Maybe you're willing to do more work if you do get a seek. Otherwise you'll need to build a more complex data structure to help you map between the two. Also, if f is a Fid* (not a File*), then you get a different f for each different Topen of the file (and thus also for each client), so the hint-per-Fid usually works pretty well in practice for this kind of thing. Russ