Subject: Re: [reiserfs-list] Directory cookie issues

From: Eric Werme USG <[email-masked]>
Date: Mon, 5 Feb 2001 11:15:04 -0500 (EST)

Hans Reiser wrote:

>We aren't saying you should tell filesystems not to use 64 bit byte
>offsets, we are saying don't require it, give us variable length
>cookies we can store filenames in and other filesystems can store
>something else in.

I understand that, sort of.  When Xuan said filename, I assumed he
meant the name of an existing file.  That's not what he said.  He
also said the name of the last file returned and I questioned that
based on my faulty assumption.

Looking at the spec (what an idea!), I think it already
is nearly sufficiently opaque:

      For subsequent READDIR requests, the client specifies
      a cookie value that is provided by the server on a previous
      READDIR request.

      The cookie value is only meaningful to the server and is used as a
      "bookmark" for the directory entry.  As mentioned, this cookie is
      used by the client for subsequent READDIR operations so that it
      may continue reading a directory.  The cookie is similar in
      concept to a READ offset but should not be interpreted as such by
      the client.  Ideally, the cookie value should not change if the
      directory is modified since the client may be caching these
      values.

So, then, are we talking simply about changing the cookie definition from

   nfs_cookie4   typedef uint64_t        nfs_cookie4;
                 Opaque cookie value for READDIR

to

   nfs_cookie4   typedef opaque        nfs_cookie4<>;
                 Opaque cookie value for READDIR

And rewording the sentence about "similar to a READ offset"?

	-Ric Werme

---

From: Xuan Baldauf <[email-masked]>
Date: Mon, 05 Feb 2001 18:42:15 +0100

> And rewording the sentence about "similar to a READ offset"?

I'd say "that's it exactly" if "<>" denotes an array whose size is
determinable at runtime and can be sufficiently large. (For our case, the
maximum length of nfs_cookie4 should be at least the maximum length of a
possible filename.)

I don't know if the wording has to change, the cookie remains to be similar
in concept to a READ offset (of the directory listing which can change over
time).

Hans, do also think that? Are their other glitches within NFS you know about
and which should go away? (E.g. The filehandle size, are 128 bytes enough?)

>         -Ric Werme

Xuân. :o)