fs.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 Fs Fs;
  10. typedef struct File File;
  11. typedef struct DirEntryEnum DirEntryEnum;
  12. //#pragma incomplete Fs
  13. //#pragma incomplete File
  14. //#pragma incomplete DirEntryEnum
  15. /* modes */
  16. enum {
  17. OReadOnly,
  18. OReadWrite,
  19. OOverWrite,
  20. };
  21. extern char *currfsysname;
  22. extern char *foptname;
  23. void fsClose(Fs*);
  24. int fsEpochLow(Fs*, uint32_t);
  25. File *fsGetRoot(Fs*);
  26. int fsHalt(Fs*);
  27. Fs *fsOpen(char*, VtSession*, int32_t, int);
  28. int fsRedial(Fs*, char*);
  29. void fsSnapshotCleanup(Fs*, uint32_t);
  30. int fsSnapshot(Fs*, char*, char*, int);
  31. void fsSnapshotRemove(Fs*);
  32. int fsSync(Fs*);
  33. int fsUnhalt(Fs*);
  34. int fsVac(Fs*, char*, unsigned char[VtScoreSize]);
  35. void deeClose(DirEntryEnum*);
  36. DirEntryEnum *deeOpen(File*);
  37. int deeRead(DirEntryEnum*, DirEntry*);
  38. int fileClri(File*, char*, char*);
  39. int fileClriPath(Fs*, char*, char*);
  40. File *fileCreate(File*, char*, uint32_t, char*);
  41. int fileDecRef(File*);
  42. int fileGetDir(File*, DirEntry*);
  43. uint64_t fileGetId(File*);
  44. uint32_t fileGetMcount(File*);
  45. uint32_t fileGetMode(File*);
  46. File *fileGetParent(File*);
  47. int fileGetSize(File*, uint64_t*);
  48. File *fileIncRef(File*);
  49. int fileIsDir(File*);
  50. int fileIsTemporary(File*);
  51. int fileIsAppend(File*);
  52. int fileIsExclusive(File*);
  53. int fileIsRoFs(File*);
  54. int fileIsRoot(File*);
  55. int fileMapBlock(File*, uint32_t, unsigned char[VtScoreSize], uint32_t);
  56. int fileMetaFlush(File*, int);
  57. char *fileName(File *f);
  58. File *fileOpen(Fs*, char*);
  59. int fileRead(File*, void *, int, int64_t);
  60. int fileRemove(File*, char*);
  61. int fileSetDir(File*, DirEntry*, char*);
  62. int fileSetQidSpace(File*, uint64_t, uint64_t);
  63. int fileSetSize(File*, uint64_t);
  64. int fileSync(File*);
  65. int fileTruncate(File*, char*);
  66. File *fileWalk(File*, char*);
  67. File *_fileWalk(File*, char*, int);
  68. int fileWalkSources(File*);
  69. int fileWrite(File*, void *, int, int64_t, char*);