home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!elroy.jpl.nasa.gov!usc!wupost!cs.utexas.edu!sun-barr!west.West.Sun.COM!cronkite.Central.Sun.COM!sixgun.East.Sun.COM!seven-up.East.Sun.COM!tyger.Eng.Sun.COM!geoff
- From: geoff@tyger.Eng.Sun.COM (Geoff Arnold @ Sun BOS - R.H. coast near the top)
- Newsgroups: comp.protocols.nfs
- Subject: Re: NFS cookies
- Date: 14 Dec 1992 00:21:56 GMT
- Organization: SunSelect
- Lines: 42
- Sender: geoff@east.sun.com
- Message-ID: <1ggk37INNha5@seven-up.East.Sun.COM>
- References: <7594@fury.BOEING.COM> <Bz7y89.2MxA@austin.ibm.com>
- NNTP-Posting-Host: tyger.east.sun.com
-
- Quoth curt@ekhadafi.austin.ibm.com (Curt Finch 903 2F021 curt@aixwiz.austin.ibm.com 512-838-2806) (in <Bz7y89.2MxA@austin.ibm.com>):
- #In article <7594@fury.BOEING.COM> krm@sdc.boeing.com (Keith Michaels) writes:
- #>Also, is there any truth to the rumor that the first byte of the cookie is
- #>reserved for use by the client? I can't find any code to substatiate
- #>that. If it's true, it also cuts down on the cookie range.
- #
- #The cookie is generated by the server and is supposed to be opaque
- #right? Clients shouldn't look at it. They shouldn't even care what's
- #in it.
-
- Correct. The only distinguished value is 0, which identifies the first
- entry in the directory search sequence. (It would be incorrect for the
- client to assume that that's the first entry in the underlying
- directory. In fact, the client isn't even allowed to assume that
- cookies are ordered in any way...) If the cookie which the client
- presents is non-zero, it MUST have been returned by the server in the
- reply to an earlier READDIR on the same directory. Thus a client cannot
- synthesize a cookie at all.
-
- There are a couple of ways that servers can implement the cookie. The
- usual way is to use the offset into the directory itself; this
- restricts the number of files to O((2^32)/avg.directory.entrysize). For
- a 64 byte entry, this gives you around 67 million files per directory.
- The second way would be to use the ordinal of the directory entry,
- which presupposes a really efficient indexing scheme..:-)
-
- Actually, there is one other thing that servers can do to try to
- improve correctness of the file system model. The server can carve off
- a portion of the cookie (8 bits is convenient) and store a version
- number derived from the modification time on the directory. This allows
- the server to detect a "stale" cookie very quickly, at the expense of
- allowing few files per directory. I don't know of any servers that do
- this, but in any case such a scheme would be transparent to the
- client.
-
- Geoff
-
- --
- Geoff Arnold, PC-NFS architect, Sun Select. (geoff.arnold@East.Sun.COM)
- ADMINISTRIVIA==========ADMINISTRIVIA=====ADMINISTRIVIA==========ADMINISTRIVIA
- New address: SunSelect, 2 Elizabeth Drive, Chelmsford, MA 01824-4195
- New numbers: Phone: 508-442-0317 FAX: 508-250-5068
-