kfs.h 861 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. typedef struct Qid9p1 Qid9p1;
  2. typedef struct Dentry Dentry;
  3. typedef struct Kfsfile Kfsfile;
  4. typedef struct Kfs Kfs;
  5. /* DONT TOUCH, this is the disk structure */
  6. struct Qid9p1
  7. {
  8. long path;
  9. long version;
  10. };
  11. //#define NAMELEN 28 /* size of names */
  12. #define NDBLOCK 6 /* number of direct blocks in Dentry */
  13. /* DONT TOUCH, this is the disk structure */
  14. struct Dentry
  15. {
  16. char name[NAMELEN];
  17. short uid;
  18. short gid;
  19. ushort mode;
  20. /*
  21. #define DALLOC 0x8000
  22. #define DDIR 0x4000
  23. #define DAPND 0x2000
  24. #define DLOCK 0x1000
  25. #define DREAD 0x4
  26. #define DWRITE 0x2
  27. #define DEXEC 0x1
  28. */
  29. Qid9p1 qid;
  30. long size;
  31. long dblock[NDBLOCK];
  32. long iblock;
  33. long diblock;
  34. long atime;
  35. long mtime;
  36. };
  37. struct Kfsfile
  38. {
  39. Dentry;
  40. long off;
  41. };
  42. struct Kfs
  43. {
  44. int RBUFSIZE;
  45. int BUFSIZE;
  46. int DIRPERBUF;
  47. int INDPERBUF;
  48. int INDPERBUF2;
  49. };
  50. extern int kfsinit(Fs*);