From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Andrew Simmons" To: 9fans@cse.psu.edu MIME-Version: 1.0 Message-ID: <3E510C04.18111.17397F5@localhost> Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: [9fans] fidtab in u9fs Date: Mon, 17 Feb 2003 16:21:24 +1300 Topicbox-Message-UUID: 63d65fa6-eacb-11e9-9e20-41e7f4b1d025 I've been looking at the source for u9fs, and am a bit puzzled by the table of fids and the newfid function. The table is declared as Fidtab *fidtab[1]; and the business part of newfid is: f = emalloc(sizeof(*f)); f->next = fidtab[fid%nelem(fidtab)]; if(f->next) f->next->prev = f; fidtab[fid%nelem(fidtab)] = f; f->fid = fid; As far as I can see, nelem(fidtab) is 1, so that fidtab is always indexed by 0, and there is only ever a single element in the table, whose next and prev elements point at itself. And if so, what's the point of the loop in lookupfid? I'm probably being really thick here, but what am I missing?