Subject: Re: Caching status between VOP_READDIR calls
To: None <tech-kern@netbsd.org>
From: Julio M. Merino Vidal <jmmv84@gmail.com>
List: tech-kern
Date: 09/09/2005 20:36:35
On 9/9/05, Joerg Sonnenberger <joerg@britannica.bec.de> wrote:
> On Thu, Sep 08, 2005 at 05:50:48PM +0200, Julio M. Merino Vidal wrote:
> > So the question is...  are the cookies used in all kinds of reads?
> > Or maybe they aren't, butl the system know where to restart a
> > readdir operation in some other way?  If so, I will simply get rid
> > of my custom variables.
>=20
> The cookies just store the "offset" for each entry, not only the last as
> would be returned to userland. It is not used by anything but NFS. On
> the other hand, if there was a bug in the handling of seeking, it would
> be exposed by normal readdir as well.

OK.  Thanks for the explanations (to Christos too).

Now I realize that my question was not very accurate...  I mean, I must
keep my caching variables because what I'm keeping track of is a
pointer, not an offset.

I wonder if the readdir operation could be modified to return a fs-specifc
cookie to ease restarts.  The problem is, this could be used by few
file-systems... or maybe only tmpfs.  I'll better forget about this for a w=
hile
;)

--=20
Julio M. Merino Vidal <jmmv84@gmail.com>
http://www.livejournal.com/users/jmmv/
The NetBSD Project - http://www.NetBSD.org/