/* * GeekOS file system * Copyright (c) 2004, David H. Hovemeyer * $Revision: 1.53 $ * * This is free software. You are permitted to use, * redistribute, and modify it as specified in the file "COPYING". */ #include #include #include #include #include #include #include #include #include #include /* ---------------------------------------------------------------------- * Private data and functions * ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- * Implementation of VFS operations * ---------------------------------------------------------------------- */ /* * Get metadata for given file. */ static int GOSFS_FStat(struct File *file, struct VFS_File_Stat *stat) { TODO("GeekOS filesystem FStat operation"); } /* * Read data from current position in file. */ static int GOSFS_Read(struct File *file, void *buf, ulong_t numBytes) { TODO("GeekOS filesystem read operation"); } /* * Write data to current position in file. */ static int GOSFS_Write(struct File *file, void *buf, ulong_t numBytes) { TODO("GeekOS filesystem write operation"); } /* * Seek to a position in file. */ static int GOSFS_Seek(struct File *file, ulong_t pos) { TODO("GeekOS filesystem seek operation"); } /* * Close a file. */ static int GOSFS_Close(struct File *file) { TODO("GeekOS filesystem close operation"); } /*static*/ struct File_Ops s_gosfsFileOps = { &GOSFS_FStat, &GOSFS_Read, &GOSFS_Write, &GOSFS_Seek, &GOSFS_Close, 0, /* Read_Entry */ }; /* * Stat operation for an already open directory. */ static int GOSFS_FStat_Directory(struct File *dir, struct VFS_File_Stat *stat) { TODO("GeekOS filesystem FStat directory operation"); } /* * Directory Close operation. */ static int GOSFS_Close_Directory(struct File *dir) { TODO("GeekOS filesystem Close directory operation"); } /* * Read a directory entry from an open directory. */ static int GOSFS_Read_Entry(struct File *dir, struct VFS_Dir_Entry *entry) { TODO("GeekOS filesystem Read_Entry operation"); } /*static*/ struct File_Ops s_gosfsDirOps = { &GOSFS_FStat_Directory, 0, /* Read */ 0, /* Write */ 0, /* Seek */ &GOSFS_Close_Directory, &GOSFS_Read_Entry, }; /* * Open a file named by given path. */ static int GOSFS_Open(struct Mount_Point *mountPoint, const char *path, int mode, struct File **pFile) { TODO("GeekOS filesystem open operation"); } /* * Create a directory named by given path. */ static int GOSFS_Create_Directory(struct Mount_Point *mountPoint, const char *path) { TODO("GeekOS filesystem create directory operation"); } /* * Open a directory named by given path. */ static int GOSFS_Open_Directory(struct Mount_Point *mountPoint, const char *path, struct File **pDir) { TODO("GeekOS filesystem open directory operation"); } /* * Open a directory named by given path. */ static int GOSFS_Delete(struct Mount_Point *mountPoint, const char *path) { TODO("GeekOS filesystem delete operation"); } /* * Get metadata (size, permissions, etc.) of file named by given path. */ static int GOSFS_Stat(struct Mount_Point *mountPoint, const char *path, struct VFS_File_Stat *stat) { TODO("GeekOS filesystem stat operation"); } /* * Synchronize the filesystem data with the disk * (i.e., flush out all buffered filesystem data). */ static int GOSFS_Sync(struct Mount_Point *mountPoint) { TODO("GeekOS filesystem sync operation"); } /*static*/ struct Mount_Point_Ops s_gosfsMountPointOps = { &GOSFS_Open, &GOSFS_Create_Directory, &GOSFS_Open_Directory, &GOSFS_Stat, &GOSFS_Sync, &GOSFS_Delete, }; static int GOSFS_Format(struct Block_Device *blockDev) { TODO("GeekOS filesystem format operation"); } static int GOSFS_Mount(struct Mount_Point *mountPoint) { TODO("GeekOS filesystem mount operation"); } static struct Filesystem_Ops s_gosfsFilesystemOps = { &GOSFS_Format, &GOSFS_Mount, }; /* ---------------------------------------------------------------------- * Public functions * ---------------------------------------------------------------------- */ void Init_GOSFS(void) { Register_Filesystem("gosfs", &s_gosfsFilesystemOps); }