home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / protocol / nfs / 2943 < prev    next >
Encoding:
Internet Message Format  |  1992-12-13  |  2.8 KB

  1. 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
  2. From: geoff@tyger.Eng.Sun.COM (Geoff Arnold @ Sun BOS - R.H. coast near the top)
  3. Newsgroups: comp.protocols.nfs
  4. Subject: Re: NFS cookies
  5. Date: 14 Dec 1992 00:21:56 GMT
  6. Organization: SunSelect
  7. Lines: 42
  8. Sender: geoff@east.sun.com
  9. Message-ID: <1ggk37INNha5@seven-up.East.Sun.COM>
  10. References: <7594@fury.BOEING.COM> <Bz7y89.2MxA@austin.ibm.com>
  11. NNTP-Posting-Host: tyger.east.sun.com
  12.  
  13. Quoth curt@ekhadafi.austin.ibm.com (Curt Finch 903 2F021 curt@aixwiz.austin.ibm.com 512-838-2806) (in <Bz7y89.2MxA@austin.ibm.com>):
  14. #In article <7594@fury.BOEING.COM> krm@sdc.boeing.com (Keith Michaels) writes:
  15. #>Also, is there any truth to the rumor that the first byte of the cookie is
  16. #>reserved for use by the client?  I can't find any code to substatiate 
  17. #>that.  If it's true, it also cuts down on the cookie range.
  18. #
  19. #The cookie is generated by the server and is supposed to be opaque
  20. #right?  Clients shouldn't look at it.  They shouldn't even care what's
  21. #in it.
  22.  
  23. Correct. The only distinguished value is 0, which identifies the first
  24. entry in the directory search sequence. (It would be incorrect for the
  25. client to assume that that's the first entry in the underlying
  26. directory. In fact, the client isn't even allowed to assume that
  27. cookies are ordered in any way...) If the cookie which the client
  28. presents is non-zero, it MUST have been returned by the server in the
  29. reply to an earlier READDIR on the same directory. Thus a client cannot
  30. synthesize a cookie at all.
  31.  
  32. There are a couple of ways that servers can implement the cookie. The
  33. usual way is to use the offset into the directory itself; this
  34. restricts the number of files to O((2^32)/avg.directory.entrysize). For
  35. a 64 byte entry, this gives you around 67 million files per directory.
  36. The second way would be to use the ordinal of the directory entry,
  37. which presupposes a really efficient indexing scheme..:-)
  38.  
  39. Actually, there is one other thing that servers can do to try to
  40. improve correctness of the file system model. The server can carve off
  41. a portion of the cookie (8 bits is convenient) and store a version
  42. number derived from the modification time on the directory. This allows
  43. the server to detect a "stale" cookie very quickly, at the expense of
  44. allowing few files per directory. I don't know of any servers that do
  45. this, but in any case such a scheme would be transparent to the
  46. client.
  47.  
  48. Geoff
  49.  
  50. --
  51. Geoff Arnold, PC-NFS architect, Sun Select. (geoff.arnold@East.Sun.COM)
  52. ADMINISTRIVIA==========ADMINISTRIVIA=====ADMINISTRIVIA==========ADMINISTRIVIA
  53. New address: SunSelect, 2 Elizabeth Drive, Chelmsford, MA 01824-4195
  54. New numbers: Phone: 508-442-0317   FAX: 508-250-5068   
  55.