home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / acorn / tech / 73 < prev    next >
Encoding:
Internet Message Format  |  1992-08-25  |  2.4 KB

  1. Path: sparky!uunet!mcsun!uknet!acorn!armltd!dseal
  2. From: dseal@armltd.co.uk (David Seal)
  3. Newsgroups: comp.sys.acorn.tech
  4. Subject: Re: Disk free space
  5. Message-ID: <5725@armltd.uucp>
  6. Date: 25 Aug 92 15:19:14 GMT
  7. References: <1992Aug24.174024.1@vxdesy.desy.de>
  8. Sender: dseal@armltd.uucp
  9. Distribution: comp
  10. Organization: A.R.M. Ltd, Swaffham Bulbeck, Cambs, UK
  11. Lines: 40
  12.  
  13. In article <1992Aug24.174024.1@vxdesy.desy.de> burke@vxdesy.desy.de writes:
  14.  
  15. >[Description of mismatch between amount of data on disc and amount of disc
  16. > space used.]
  17. >
  18. >  To investigate a bit further, I tried creating a directory (in the root);
  19. >the free space dropped by 13Kb (exactly). I created another directory,
  20. >and it dropped by another 18Kb. I then created a 1-byte-long file; the
  21. >free space didn't change at all! I created another 1-byte file, and again
  22. >the free space didn't change. Does anyone understand this?
  23.  
  24. What is going on is that ADFS allocates space in large chunks. When you
  25. create a directory, it gets a lot of space, 2k of which is used for the
  26. directory itself. The rest of the space is reserved for small files in that
  27. directory. So you lose a lot of space when you create the directory, then
  28. don't lose anything when the small file is created, since it is using the
  29. previously reserved space.
  30.  
  31. (I'm not quite certain why you're getting different amounts for different
  32. directories. Possibly it's due to the free space being in small chunks -
  33. e.g. ADFS looks for a chunk of size 10k and finds a gap in the free space
  34. map of length 13k. It can't allocate you just 10k, since the remaining 3k is
  35. too small to be allocatable, so it gives you 13k. Next time, it finds a gap
  36. of size 18k. Again, the remaining 8k is too small, so it gives you the whole
  37. thing.)
  38.  
  39. This has obvious possible disadvantages - e.g. the possibility that the
  40. reserved space won't get used. But it also has a number of advantages: for
  41. instance, it allows the free space map to be stored very compactly and
  42. accessed efficiently. Another one is that small files tend to be stored in
  43. the same area on disc as the directory they're in: this often reduces the
  44. number of disc seeks you need to access the file (i.e. when you seek to the
  45. correct place to get the directory, you automatically find yourself in the
  46. right place to read the file itself without a further seek). The result is
  47. faster access to files.
  48.  
  49. David Seal
  50. dseal@armltd.co.uk
  51.  
  52. All opinions are mine only...
  53.