kfs.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * This file is part of the UCB release of Plan 9. It is subject to the license
  3. * terms in the LICENSE file found in the top-level directory of this
  4. * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
  5. * part of the UCB release of Plan 9, including this file, may be copied,
  6. * modified, propagated, or distributed except according to the terms contained
  7. * in the LICENSE file.
  8. */
  9. typedef struct Qid9p1 Qid9p1;
  10. typedef struct Dentry Dentry;
  11. typedef struct Kfsfile Kfsfile;
  12. typedef struct Kfs Kfs;
  13. /* DONT TOUCH, this is the disk structure */
  14. struct Qid9p1
  15. {
  16. long path;
  17. long version;
  18. };
  19. //#define NAMELEN 28 /* size of names */
  20. #define NDBLOCK 6 /* number of direct blocks in Dentry */
  21. /* DONT TOUCH, this is the disk structure */
  22. struct Dentry
  23. {
  24. char name[NAMELEN];
  25. short uid;
  26. short gid;
  27. ushort mode;
  28. /*
  29. #define DALLOC 0x8000
  30. #define DDIR 0x4000
  31. #define DAPND 0x2000
  32. #define DLOCK 0x1000
  33. #define DREAD 0x4
  34. #define DWRITE 0x2
  35. #define DEXEC 0x1
  36. */
  37. Qid9p1 qid;
  38. long size;
  39. long dblock[NDBLOCK];
  40. long iblock;
  41. long diblock;
  42. long atime;
  43. long mtime;
  44. };
  45. struct Kfsfile
  46. {
  47. Dentry;
  48. long off;
  49. };
  50. struct Kfs
  51. {
  52. int RBUFSIZE;
  53. int BUFSIZE;
  54. int DIRPERBUF;
  55. int INDPERBUF;
  56. int INDPERBUF2;
  57. };
  58. extern int kfsinit(Fs*);